Field availability dependant on combo box choice

S

Sarella

Hi,

I have created a database that will be used amongst other things to raise
purchase orders (PO). On my PO form I have a combo box which the user uses
to specify if the order is for consumables, hire weekly, hire daily and
delivery. What I want to happen is that if they pick either hire weekly or
hire daily the field next to it becomes available into which they can specify
the number of days / weeks, however if they chose any of the other options,
the field is not accessible, or hidden.

I know the answer is probably already listed somewhere, I'm just not sure
what to look for it under!

Many thanks for any suggestions

Sarella
 
R

RonaldoOneNil

Put code similar to this in the after update event of your combo box and also
in the On current event of the form

If Me.ComboBoxName = "Hire Weekly" or Me.ComboBoxName = "Hire Daily" Then
Me.TextBoxName.Visible = True
Else
Me.TextBoxName.Visible = False
End If
 
Joined
Jan 20, 2010
Messages
3
Reaction score
0
Hi,

I've done as described, putting the code in the after update field of the combo box, and the on current of the form:

If Me.Combo8 = "Weekly Hire" or Me.Combo8 = "Daily Hire" Then
Me.Text10.Visible = True
Else
Me.Text10.Visible = False
End If

However it doesn't seem to work - the new field (text10) is available regardless as to what is chosen. This form is utilised as a subform of another and is viewed as a datasheet- does this make a difference?

Many thanks for your help :O)
 
Last edited:

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