Checkboxes in Form

Staelens30

Registered User.
Local time
Today, 06:44
Joined
Sep 29, 2010
Messages
16
I am trying to use check boxes that if clicked more feilds open up on the form to be filled out. if not chekced the fields remain hidden.
any suggestions?
 
Use the afterupdate event of the check box. A checked box has a value of -1 or True. An empty check box has the value of 0 or False. Use an If statement or Case Select to determine what fields to hide or unhide based on the users selections of the check boxes.
 
do i have to create additional forms or can all of this be on the same form
 
could you give me an example of the if formula i would type to make the hidden fields to show or the shown fields to hide or would it be VBA coding
 
put your boxes on the form, probably with intial property set to visible=no (to prevent possible flickering)

in the currentevent put code, setting the control names as appropriate

newfield1.visible = checkbox1
newfield2.visible = checkbox2

you will also need this code in the afterupdate event for each of the checkboxes
 
ok i have tried a few different ways and keep getting an error. If I want to click a check named Two Buyers I would like the labels and text boxes to come up to input the second buyers information.
 
What is the exact name of your check box for the Two Buyers field?
What is the exact name of your label and text field for the Second Buyers?

It should be something like cbTwoBuyers and lblSecondbuyers & txtSecondBuyers if you are using a standard naming convention.

In the AfterUpdate event of the cbTwoBuyers, your code should look something like this...

Code:
lblSecondbuyers.Visible = cbTwoBuyers
txtSecondBuyers.Visible = cbTwoBuyers

If you still have problems then you need to post the code you are using for us to be able to help.
 
that worked perfectly. Now i have another problem how do i get the fields below to move when the others are not in use. by this i mean if i have them hidden and are not being used there is a gap where they are going to show but i would like the form to gap free and expand when the appropriate check box is checked.
 

Users who are viewing this thread

Back
Top Bottom