Switching between Text and Combo

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.
 
G

Guest

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.
 
G

Guest

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!
 
G

Guest

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?
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top