R
Robert Landers via AccessMonster.com
Hi all,
I have a main form called "Contacts". This form has a combo-box on it,
called "PersonTypeID", which contains a lookup field with the available
values being "Individual" and "Company".
I also have two subforms called "Individuals" and "Companies".
At present, I have set the "visible" properties of both subforms to "No".
I want to set up the form so that when I select "Individual" from the combo-
box, it sets the visible property of the "Individuals" subform to "Yes".
I have tried the following steps but keep running into errors:
1. Select the combo box
2. Go to Events properties
3. Select OnChange event ...
4. Select Expression Builder
5. Go to Forms, Loaded Forms, Contacts, Individuals
6. Doubl-click on the "visible" property and set it to "False", giving me
the following expression: [Individuals].Form.Visible=True
But this results in the following error when I select from the drop-down
menu: "Microsoft Access can't find the macro 'Individuals'".
As, an alternative, I follow steps 1 to 3 above, and select "Code Builder"
instead of "Expression Builder". This opens a code window which I alter to
read as follows:
Private Sub PersonTypeID_Change()
Me.Individuals.Visible = True
End Sub
At this stage, I'm leaving out the If/Then statements just to see if I can
change the visible property value. Even so, I keep running into this error:
"The expression On Change you entered as the event property setting
produced the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or ActiveX Control."
To be honest, I would have thought what I'm trying to achieve would be very
simple. Can anyone give this newbie some guidance?
TIA
Robert
I have a main form called "Contacts". This form has a combo-box on it,
called "PersonTypeID", which contains a lookup field with the available
values being "Individual" and "Company".
I also have two subforms called "Individuals" and "Companies".
At present, I have set the "visible" properties of both subforms to "No".
I want to set up the form so that when I select "Individual" from the combo-
box, it sets the visible property of the "Individuals" subform to "Yes".
I have tried the following steps but keep running into errors:
1. Select the combo box
2. Go to Events properties
3. Select OnChange event ...
4. Select Expression Builder
5. Go to Forms, Loaded Forms, Contacts, Individuals
6. Doubl-click on the "visible" property and set it to "False", giving me
the following expression: [Individuals].Form.Visible=True
But this results in the following error when I select from the drop-down
menu: "Microsoft Access can't find the macro 'Individuals'".
As, an alternative, I follow steps 1 to 3 above, and select "Code Builder"
instead of "Expression Builder". This opens a code window which I alter to
read as follows:
Private Sub PersonTypeID_Change()
Me.Individuals.Visible = True
End Sub
At this stage, I'm leaving out the If/Then statements just to see if I can
change the visible property value. Even so, I keep running into this error:
"The expression On Change you entered as the event property setting
produced the following error: A problem occurred while Microsoft Access was
communicating with the OLE server or ActiveX Control."
To be honest, I would have thought what I'm trying to achieve would be very
simple. Can anyone give this newbie some guidance?
TIA
Robert