Combo box issue

whitelexi

New member
Local time
Today, 14:02
Joined
Jun 5, 2009
Messages
7
Hi all,

I have created an auto-form from my table, and on that auto-form, i've created a combo box with some values in it. What i want to do is:

When a particular value from that combo box is selected, i want 2 more fields to become visible so that my employees can add further information into those fields.

I have created extra columns in my table to record entries into those extra fields, I have also created extra text boxes on my auto-form which are bound to the columns i've added to my table but made them not visible for now, however my access knowledge is a bit rusty and i cant figure out what code to enter so that when the required value is selected from my combo box, those fields can become visible and able to record further infor into my table.

Any ideas how this can happen will be greatly welcomed.:)
 
Use the after update event of the combo box to test for a valid conditon then

me.HiddenControl.Visible = True

Where HiddenControl is the name of your hidden control on the form.

David
 
As David suggested you want to code the AfterUpdate event of the combobox in question. However, I suspect you want to display and hide the textboxes depending on which value the user has selected from the combobox. In this case, you will need an IF or SELECT CASE statement.

If me.cboSelected = "Option1" then
me.txtHiddenControl1.Visible = true
ElseIf me.cboSelected = "Option2" then
me.txtHiddenControl2.Visible = true
End If

This assumes you have two textboxes named txtHiddenField1 and txtHiddenField2 that depend on the option selected in a combobox called cboSelected.
 

Users who are viewing this thread

Back
Top Bottom