Access: Cause a block of info to appear/disappear with Yes/No?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I respond with a "Yes" in a Y/N field, I want to be able to see an
additional block of info appear. With a no, nothing would happen. How do I
do this?
 
Rick

One approach would be to add code to the checkbox's AfterUpdate event.
Note: this assumes you are working in a form, not directly in the table.

If you added something like:

Me![MyAdditionalInfo].Visible = Me!chkMyCheckBox

changing the value in the yes/no (i.e., checkbox) field causes the visible
property of the additional info to change.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Rick said:
When I respond with a "Yes" in a Y/N field, I want to be able to see
an additional block of info appear. With a no, nothing would happen.
How do I do this?

I'm not sure whether your "block of info" is a single control, such as a
text box, or a set of controls. Either way, essentially what you would
do is use the Y/N field's AfterUpdate event (and probably the form's
Current event as well) to set the Visible property of the control(s) you
want to show or hide. In a simple case, the event procedures could look
like this:

'----- start of example code -----
Private Sub chkShowHide_AfterUpdate()

Me!txtSomeInfo.Visible = Me.chkShowHide.Value

End Sub

Private Sub Form_Current()

Me!txtSomeInfo.Visible = Me.chkShowHide.Value

End Sub
'----- end of example code -----
 
I received two responses. Both points of view were excellent. I think I'm
 

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

Back
Top