Ahmed
Ahmed

Reputation: 824

Switching between forms in Subform panel in Microsoft access

I am new in Microsoft Access. What i want is to switch between forms in subform panel depending upon the user selects from drop down list. Attach file contains what i want enter image description here

I google alot but didnt find any help. Thank you for your help.

Here is screen shot. but I am confused in finding control of subform. enter image description here

Upvotes: 0

Views: 2376

Answers (1)

KekuSemau
KekuSemau

Reputation: 6856

Forms("frmMain").Form.subFormControl.SourceObject = "SubForm_2_A"

..should be all you need.
subFormControl is the name of the subform-container-control that contains Subform2.
frmMain is the name of the parent form, not labelled in your picture (actually, you might not have to put subform1 in a subform really, its content could be on the parent form).

EDIT:
The red frame marks a subform. Click on -1- to make sure the main form has the focus. Then click once on -2- and the control is selected, and its properties show up in the properties box on the right.
Note that you find the "source object" in the data page and the name of the control in the "other" page. Access makes the name (of the control) the same as the form, which is really not such a bright idea and rather confusing.

SampleImage

Upvotes: 3

Related Questions