VBA and Subforms

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hello.

I am currently re-doiong a database that someone else
created. Origianally, they had a form, "frmSelectType",
with a button on it the performs a certain action.

Set frm = Forms!frmSelectClearance

While re-doing the database I have sence
placed "frmSelectType" as a subform on
form "frmReportsMenu". Now when I click the action button
I recieve an error stating that "MS Access can't find the
form "frmSelectType" referred to in a macro expression or
Visual Basic code." and it points to this line of code:

Set frm = Forms!frmSelectType

I have very, VERY little VBA knowledge. What is the
syntax to tell the code that "frmSelectType" is now a
subform of "frmReportsMenu".

Thanks in advance,

m.
 
Mike said:
Hello.

I am currently re-doiong a database that someone else
created. Origianally, they had a form, "frmSelectType",
with a button on it the performs a certain action.

Set frm = Forms!frmSelectClearance

While re-doing the database I have sence
placed "frmSelectType" as a subform on
form "frmReportsMenu". Now when I click the action button
I recieve an error stating that "MS Access can't find the
form "frmSelectType" referred to in a macro expression or
Visual Basic code." and it points to this line of code:

Set frm = Forms!frmSelectType

I have very, VERY little VBA knowledge. What is the
syntax to tell the code that "frmSelectType" is now a
subform of "frmReportsMenu".

Forms!NameOfParentForm!NameOfSubFormControl.Form!frmSelectClearance

NOTE:
In the syntax above you need the name of the subform *Control* found on the
parent form. This will usually (but not always) have the same name as the
form inside of it.
 
Back
Top