S
Surveyor In VA via AccessMonster.com
Hello
I have a form called "Form1" who has a subform called "subform1". Depending
on what the user picks as the source object, subform 1 can be either 1.)
frmCalendar, 2.) frmContacts or 3.) frmProjects.
On each one of these forms (frmCalendar, frmContacts, and frmProjects) I have
a routine called Public Sub RefreshForm ()
This routine turns on a progress bar, runs a different function depending on
the form.
I have created a button on Form1 that I would like to call this routine. I
have created the following code on the On_Click Event
Dim txtModule1 as String
'Sets the form to open
txtModule1 = Me.Subform1.SourceObject
Set MySubform = Forms(txtModule1)
'Call refresh
Call MySubform.RefreshForm
When I click the button an error comes up saying that "frmCalendar" can not
be found, but I took the name directly from the SourceObject for the subform.
Is there something else that I should be doing?
Regards,
Chris F.
I have a form called "Form1" who has a subform called "subform1". Depending
on what the user picks as the source object, subform 1 can be either 1.)
frmCalendar, 2.) frmContacts or 3.) frmProjects.
On each one of these forms (frmCalendar, frmContacts, and frmProjects) I have
a routine called Public Sub RefreshForm ()
This routine turns on a progress bar, runs a different function depending on
the form.
I have created a button on Form1 that I would like to call this routine. I
have created the following code on the On_Click Event
Dim txtModule1 as String
'Sets the form to open
txtModule1 = Me.Subform1.SourceObject
Set MySubform = Forms(txtModule1)
'Call refresh
Call MySubform.RefreshForm
When I click the button an error comes up saying that "frmCalendar" can not
be found, but I took the name directly from the SourceObject for the subform.
Is there something else that I should be doing?
Regards,
Chris F.