Switching between Text and Combo

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry if this is a basic request but I’m new at this!

I have two fields in a table:
Customer: Choose from ‘Client’, ’Company’ or ‘Contractor’. I have set this
up as a Combo box value list.

Company Name: I want this field to give to be set to a text field if
‘Client’ or ‘Company’ is selected from the Customer field but when
‘Contractor is selected to provide a drop down with all the Company names we
deal with.

I have a vague idea this is possible but not sure how. Basic instructions
would be more than appreciated!!

Thanks for any advice.
 
I don´t know if there is another way to do it, but I usualy use two fields,
one text, another combo, ontop of each other and switch between them(visible
or invisible), according to the value of the first selection, and bound them
to the same db field. Hope this helps.
 
Sounds like what I want to do.
Questions:
How do I make a field Visible or invisible depending in whats in another
field?

Sorry its probably a stupid question!
 
There are no stupid questions. Stupid is not to ask! :-)
I would use the "After Update" event, of the combo where you select
‘Client’, ’Company’ or ‘Contractor’.
I think it should look something like this:

Private Sub Combo1_AfterUpdate()
If Combo1 = "Contractor" Then
TextField.Visible = False
Combo2.Visible = True
Else
TextField.Visible = True
Combo2Field.Visible = False
End If
End Sub
Got it?
 
Sorry on the "Else" statement I wrote Combo2Field, it should be just Combo2
it's your second combo, the one you filled with your contractors list.
 
Back
Top