Creating combo box to open multiple blank fields

BlueStarBrite

Registered User.
Local time
Yesterday, 22:40
Joined
Jan 15, 2009
Messages
23
If I have a combo box that lists, servicetype - and i want the user to select the servicetype and then three blank text fields appear for data entry. I want to save all this info into 1 table. How do I do this? :confused:

Ex: Servicetype = Service1
TxtboxA: _____ TxtboxB: _____ TxtboxC: _____

Thanks!
 
Is it the same three boxes that appear when the combo is selected? Or do the three boxes that appear depend on the selection made in the combo?
 
Is it the same three boxes that appear when the combo is selected? Or do the three boxes that appear depend on the selection made in the combo?

The three boxes will depend on the selection made in the combo box - due to the fact they are all seperate columns in my table.
 
You will need something like the following in the On Change Event of your Combo;

Code:
If Me.ComboName.Value = 1 Then
     Text1.Visible = True
     Text2.Visible = True
     Text3.Visible = False
     Text4.Visible = False
     Text5.Visible = False
     Text6.Visible = False
Else If Me.ComboName.Value = 2 Then
     Text1.Visible = False
     Text2.Visible = False
     Text3.Visible = True
     Text4.Visible = True
     Text5.Visible = False
     Text6.Visible = False
Else
     Text1.Visible = False
     Text2.Visible = False
     Text3.Visible = False
     Text4.Visible = False
     Text5.Visible = True
     Text6.Visible = True
End If

You will need to change the values that you are testing, your Combo Box, for to reflect the values that your Combo actually holds. Additionally you will also need to put a variation of this code in the form's On Current event, in which you will also need to test for the Default Value of your Combo and have all the text boxes set as Visible = False
 

Users who are viewing this thread

Back
Top Bottom