Hiding a form

J

jman

I'm an intern and have been basically thrown into the world of Access so I am
basically teaching myself.

I have a form with a yes/no box. If the answer is yes, I would like to ask
for additional information which I then plan to use in combination with other
form information to create a unique report. I do not want this information
always visible though. Is there a way (possibly using subform?) to hide the
form until the yes/no box is clicked as yes?

Also, is there a way to make that clicked yes/no box translate into a word
yes/no in a report?
 
L

Lynn Trapp

You obviously don't want to hide the form until the 'yes' answer is given,
because then you couldn't see the checkbox in order to click it. Instead,
you need to hide all the other fields until it is clicked. In the Click
event of your yes/no control, put the following code.

Me.SomeField.Visible = Me.YourCheckBox

You will also want to put it in the Current event of the form. Put that code
in both events for each field on the form.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html
 
J

jman

I think I was unclear when I asked my original question. I was asking to hide
the fields in the form related to whether the answer of the checkbox was yes
or no. That's why I asked about maybe using a subform.

Also, when I put the code in where you instructed me to it said Me is not a
valid macro.

I have Access XP (which translates to Access 2002) if that makes a difference.
 
J

jman

When I put the "Me.SomeField.Visible = Me.YourCheckBox" code in for the
current it told me "Compile error: Method or data member not found."

This was the code as I entered it:

Option Compare Database

Private Sub Form_Current()
Me.SomeField.Visible = Me.YourCheckBox
End Sub

Private Sub Inspection_required_Click()
Me.SomeField.Visible = Me.YourCheckBox
End Sub

Private Sub Revision_Level_Click()
Me.SomeField.Visible = Me.YourCheckBox
End Sub

Revision level was the thing I was trying to hide. Inspection required was
the yes/no.
 

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

Similar Threads

Split form 0
Help counting multiple checkboxes in a form to make a total in a report 3
Hide/Show Text Form View 2
Pause VB Code 1
Help with Form Field 0
Can't hide Property Sheets 1
Form Question 2
hide control? 6

Top