Hiding/Showing fields on form depentant on another field

shard

New member
Local time
Tomorrow, 03:09
Joined
Aug 5, 2009
Messages
3
Hey all.

I've been asked to make a database of customers to contact. Pretty general sort of stuff, except for one bit that my lack of experience stops me being able to do.

There is a field on the form called "outcome" which is a lookup box that lets users pick from a list of possible outcomes upon completing a call to that customer. What I need to do is make the form show some extra fields next to the outcome box depending what the user selects in the outcome box.

So if nothing is selected, I don't want to see the extra fields. However if a users selects "Appointment Made" I need a field to be shown where the user can enter the appointment date and time. There are a total of 7 possible outcomes, and of those 7, 4 have extra fields to be shown.

Can anyone help me out with a solution??

-Matt
 
In the after update event of that control (and perhaps also the current event), use code to test the value of the control and set your other controls appropriately. Given the number of selections, I'd use Select/Case. Check that out in VBA help and see how it goes.
 
You can use a logical test (If Then statement) to test the value of one filed and then either show our hide other fields by changing their Visible property to either True or False, dependant on the result of the test.

You would need this test in the field's On Change event as well as the forms On Current event.
 

Users who are viewing this thread

Back
Top Bottom