views:

17

answers:

1

Hey everyone!

I need to gather some information from a Microsoft Access form and I need everything to be as organized as possible.

There are a lot of columns that can be filled out, but don't necessarily apply to everyone and I want to keep everything as clean as possible.

In a form, is there any way to have certain input boxes displayed only if the user says they have that information?

For example:

  • Do you have a dog? () yes (o) no

  • Do you have a dog? (o) yes () no.............Dog name: [_____________]

The yes's/no's shouldn't be added to the database, but I can dump them somewhere if need be.

Thanks in advance!

Justian

P.S I'd like to put this on SharePoint as well, so extra brownie points if you can run me through that as well real quick. Thanks again!

+1  A: 

The way I usually handle this is with an option group for the first question, and a disabled text box for the other information, inside the frame of the option group. In the AfterUpdate event of the option group, you set the enabled property of the textbox:

  Me!txtDogName.Enabled = (Me!optHasADog = 1)

...assuming that the value of the YES choice is 1.

You'd likely want to set the default value of the option group to the NO choice, and then you'd have the name field disabled by default.

You would also need the OnCurrent event of your form to do the same thing as in the AfterUpdate event.

David-W-Fenton