Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

How to reference Userform in another project

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
singeredel - 21 Feb 2005 00:15 GMT
I am trying to figure out how to reference a form in another project in order
to pass variables to it. This is what I have:

  With Hannani_TestTemplate.frmCreate_Hannani_Personal
       .txtRptDateMonth.Text = "02"
       .txtRptDateDay.Text = "17"
       .txtRptDateYear.Text = "2005"
       .show
  End With

The project name is "Hannani." The template name is "Hannani_Test.dot", the
form name is "frmCreate_Hannani_Personal". I keep getting an "object" error.

Thank you.
Signature

singeredel

Jezebel - 21 Feb 2005 00:31 GMT
You can do it by adding a reference: Make sure the Hannani_Test template is
loaded -- either directly or because you have a document based on it. Select
the source project in VBA, then go to Tools > References. Scroll down until
you find Hannani_Test and check the box next to it.

Bear in mind that Hannani_Test has to be loaded every time for your code to
work. A better approach might be to put the common code into an add-in, to
be called by any project -- including Hannani -- that needs it.

>I am trying to figure out how to reference a form in another project in
>order
[quoted text clipped - 13 lines]
>
> Thank you.
Ulf Nilsson - 21 Feb 2005 07:48 GMT
Hi,
Is it possible to select this template using VBA? We have
templates in the user's profile that needs to connect to
each other.

/ Ulf

>-----Original Message-----
>You can do it by adding a reference: Make sure the Hannani_Test template is
[quoted text clipped - 25 lines]
>
>.
singeredel - 21 Feb 2005 16:11 GMT
"I can't seem to get this to work. I have a reference to "Hannani_Test.dot"
in the "InitialVariables" project, "Initial_Variables" module, "References".
Both "Hannani_Test.dot and "InitialVariables.dot" are checked in "Templates
and Add-Ins." The following Procedure appears in the InitialVariables
Project, Initial_Variables module:

Sub Test()

With Hannani_TestTemplate.frmCreate_Hannani_Report
       .txtReportDateMonth.Text = "02"
       .txtReportDateDay.Text = "17"
       .txtReportDateYear.Text = "2005"
       .txtDictationDateMonth.Text = "02"
       .txtDictationDateDay.Text = "17"
       .txtDictationDateYear.Text = "2005"
       .txtBillingPeriod.Text = "021605-022805"
       .optLosAngeles.Value = False
       .optSanBernardino.Value = False
       .optWestCovina.Value = True
       .Show
   End With

End Sub

I still get a run-time error 424: Object required.

What am I missing?

> You can do it by adding a reference: Make sure the Hannani_Test template is
> loaded -- either directly or because you have a document based on it. Select
[quoted text clipped - 22 lines]
> >
> > Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.