Display and Empower multiple subforms

  • Thread starter Thread starter prosfora via AccessMonster.com
  • Start date Start date
P

prosfora via AccessMonster.com

Combo boxes cboTN and cboSB are on my main form. cboTN is a search combo box
that updates combo box cboSB with one of 3 values (ID, IDC, or MC).

I would like to do the following:

1:
If the after-update value of cboSB is ID, subform sf1 will be visible.
If the after-update value of cboSB is IDC, subform sf2 will be visible.
If the after-update value of cboSB is MC, subform sf3 will be visible.
(only one subform visible at a time since they are stacked in one place on my
main form)

2:
Once the appropriate subform is displayed, is it possible to use option
buttons to set the property of the subform to either Add-only mode or Edit-
only mode? If so, how? (perhaps some sort of Case A, Case B scenario with the
option buttons?)

If you can help with either of the above; example codes would help my novice
skills greatly!
 
hi,


You can change the form displayed in a subform control through code, by
changing the SourceObject property of the (subform) control:


Me.SubFormControlName.SourceObject= "NameOfTheFormToUse"


so you have only one sub-form control, into which you display different
forms, as required.


To change the properties of the form used in the subform control Child0, use
something like:


Me.Child0.Form.AllowEdits = False



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top