Fields appearing when a value is selected from dropdown

ppataki

Registered User.
Local time
Today, 01:43
Joined
Sep 5, 2008
Messages
267
Dear All,

I would like to know how it can be done that if there is a "Yes/No" dropdown or an option box and if eg. "Yes" is selected then a number of other fields appear on the form to be filled in

Many thanks in advance! ;)
 
For a drop down value maybe:

In the afterupdate

If Me.combo.Value = "1" Then

Me.Text1.Visible = True
Me.Text2.Visible = True
Me.Text3.Visible = True


End If

You would need this in form open event:

Me.Text1.Visible = False
Me.Text2.Visible = False
Me.Text3.Visible = False

See this thread to:

http://www.access-programmers.co.uk/forums/showthread.php?t=167900

As there are some other things to think about....

good luck John
 
Thank you for the reply, it works pretty nicely!
 
I just have one more question:
If I insert a combo box or an option group, whenever I open the form the combo box lists the first value by default (however I did not set that) and the option group is greyed out until I click in it
How can I make the combo box show null value by default? (I tried to write something in the Default Value but did not work) and how to make the option group be not grey but white?

Many thanks for your help in advance
 
Shouldn't show anything if you are using an SQL query to populate the combobox and the default value is empty can't really say why it is greyed out without seeing an example of what you have done so far....


Good luck John
 
I solved it in the meantime:
I put Null to the Default value and now it shows nothing by default
In case of the Option group I put Yes to the Default value and now it is neither greyed out nor showing "Yes", it is just "white" by default
 

Users who are viewing this thread

Back
Top Bottom