show fields in a form based on value selected from a combo

Emma

Registered User.
Local time
Today, 22:52
Joined
May 11, 2000
Messages
37
Please can anyone help me! I need to show certain fields when a value is selected from a combo box - so if a user selects "A" from a combo box, they see fields 1,2 and 3 or if they select "B" from the combo - they see fields 1,2,4 and 5.
Ta!
 
One way to do this would be to start off by making all the fields in your form invisible. Then when the user selects his option you make the appropriate fields visible. You could do this by putting some code in the AfterUpdate event of your combo. For example

if myCombo = "A" then
text1.visible = true
text2.visible = true
text3.visible = true
elseif myCombo = "B" then
text1.visible = true
text2.visible = true
text4.visible = true
text5.visible = true
endif

To keep the whole thing consistent you need to make all fields invisible each time you move to another record. You can do this by putting code in the forms Current event that makes all the fields invisible.

Hope this helps
 

Users who are viewing this thread

Back
Top Bottom