How do I set a subform to appear based on a form entry.

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

Mike

Hi,
I am trying to to set up a form for equipment data
entry and would like to be able to have a seperate
subform appear based on the selection for equipment
category. Here is what I have;


CategoryID (ComboBox)[This is a pulldown list from a
seperate table (Equipment Category)]

There are everal category and I would like my subform to
be chosen from a set of existing forms each related to a
seperate category. Any help woul be greatly appreciated.

thanks,

Mike
 
Hi,
Maybe something like this in the combo's AfterUpdate:

Select Case me.yourCombo
Case 1 'this would be your CategoryId
Me.yourControlName.SourceObject = "someForm"
Me.yourControlName.LinkChildFields = "something"
Me.yourControlName.LinkMasterFields = "something"
Case 2
'repeat above with different parameters
End Select

The disadvatage with the above is that if you add a new category you have to
change the code to include it.
 
Back
Top