Help needed with combo box

BAzZ

Registered User.
Local time
Today, 20:52
Joined
Nov 13, 2002
Messages
60
I have a form which has a list box, I want to be able to select one of it's options, and on it's selection, have some fields on the form become visible. How would I go about doing this?
 
You could use a case select on the After Update event of the combo box:

Select Case Me.Comboboxname

case 1 '1 being the autonumber for the 1st option available to users from the list in the combo box
Me.Field1.visible = false
Me.field2.visible = false
me.field3.visible = true
me.field4.visible = true

case 2 '2 being the autonumber for the 2nd option available to users from the list in the combo box
Me.Field1.visible = true
Me.field2.visible = true
me.field3.visible = false
me.field4.visible = false

End Select
 
Thanks for that, it worked like a charm!

With this though, I have a lot of fields that I want to be able to hide. Can I group fields and then just hide the group?
 
And how about with another list box I have, it uses a lookup table, with three fields, what do I do to get a selection from the list box, to fill in fields in a table, but the fields aren't on the form?
 
BazZ,

Unfortunately the group/ungroup option only works in design field so you need to handle each field seperately. What I do in some situations when I have a group of fields to hide is have a rectangle over them and just make the rectangle visible to hide the fields, invisible to show the fields.

I'm not sure I understood your last question but if you want to access the three fields in your list box, use Column.

Me!ListBoxName.Column(0) ' column 1
Me!ListBoxName.Column(1) ' column 2
 
I'll try and explain better, I have three columns in a list box, one for Community to visit, Land Trust, and Region. On the main form it doesn't need Land Trust or Region, but, I need that information filled into the table. Is there a way to get these filled in without having the fields on the form?
 

Users who are viewing this thread

Back
Top Bottom