Data Entry Form Changes Dependent On Drop Down

S

serviceenvoy

I need to create a data entry form that changes what fields are
displayed, required, and auto-filled based on a drop down combo box.
How do I do that?

For example:
If I select "Client1" in the drop down I will need fields a, b, & c to
display
If I select "Client2" in the drop down, I will only need fields a & b.
If I select "Client3" from the drop down, I will need fields a,b,c,d,
& e.

Please help.
 
D

Douglas J. Steele

Put logic in the combo box's AfterUpdate event:

Private Sub MyCombo_AfterUpdate

Select Case Me!MyCombo
Case "Client 1"
Me!FieldA.Visible = True
Me!FieldB.Visible = True
Me!FieldC.Visible = True
Me!FieldD.Visible = False
Me!FieldE.Visible = False
Case "Client 2"
Me!FieldA.Visible = True
Me!FieldB.Visible = True
Me!FieldC.Visible = False
Me!FieldD.Visible = False
Me!FieldE.Visible = False
Case "Client 3"
Me!FieldA.Visible = True
Me!FieldB.Visible = True
Me!FieldC.Visible = True
Me!FieldD.Visible = True
Me!FieldE.Visible = True
Case Else
' What happens for the other selections?
End Select

End Sub
 
S

serviceenvoy

Put logic in the combo box's AfterUpdate event:

Private Sub MyCombo_AfterUpdate

Select Case Me!MyCombo
Case "Client 1"
Me!FieldA.Visible = True
Me!FieldB.Visible = True
Me!FieldC.Visible = True
Me!FieldD.Visible = False
Me!FieldE.Visible = False
Case "Client 2"
Me!FieldA.Visible = True
Me!FieldB.Visible = True
Me!FieldC.Visible = False
Me!FieldD.Visible = False
Me!FieldE.Visible = False
Case "Client 3"
Me!FieldA.Visible = True
Me!FieldB.Visible = True
Me!FieldC.Visible = True
Me!FieldD.Visible = True
Me!FieldE.Visible = True
Case Else
' What happens for the other selections?
End Select

End Sub

Thanks for that. Now, I have a field in that needs to have a certain
value, depending on another field. If the "Client" field is "ClientA"
then field "Invoice" should be "Not Required". If, however, the
"Client" field is "ClientB" or "ClientC" the "Invoice" field should be
blank. How do I accomplish that?
 
B

biganthony via AccessMonster.com

if Client="ClientA" then
Invoice="Not required"
else
Invoice=" "
endif


that needs to have a certain
 

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