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

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
 
D

Dan Artuso

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top