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.
--
singeredel

Re: How to reference Userform in another project by Jezebel

Jezebel
Sun Feb 20 18:31:25 CST 2005

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.






"singeredel" <singeredel@discussions.microsoft.com> wrote in message
news:F4E6B9BD-CB48-4AB8-9505-8747224B49F4@microsoft.com...
>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.
> --
> singeredel



Re: How to reference Userform in another project by Ulf

Ulf
Mon Feb 21 01:48:41 CST 2005

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
>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.
>
>
>
>
>
>
>"singeredel" <singeredel@discussions.microsoft.com>
wrote in message
>news:F4E6B9BD-CB48-4AB8-9505-
8747224B49F4@microsoft.com...
>>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.
>> --
>> singeredel
>
>
>.
>

Re: How to reference Userform in another project by singeredel

singeredel
Mon Feb 21 10:11:04 CST 2005

"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?

"Jezebel" wrote:

> 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.
>
>
>
>
>
>
> "singeredel" <singeredel@discussions.microsoft.com> wrote in message
> news:F4E6B9BD-CB48-4AB8-9505-8747224B49F4@microsoft.com...
> >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.
> > --
> > singeredel
>
>
>