Trying to "Grey Out" unwanted fields in a data entry form

C

Chris

I have a table with about 20 fields, one of them being "Analysis
Type". There are 6 of these types. I then have a form in my self-
made switchborad with 6 command buttons, all allowing the user to
choose which type of analysis he wants - which then leads to the
appropriate form. Now, what I am trying to do is make one big generic
data entry form for each analysis type. For instance, if the user
selects analysis type "X", then the generic data entry form comes up
with all fields in the form listed, but the ones not pertinant to that
analysis type are "greyed out" and locked. Some analysis types might
only need 5 fields filled, out, while another might require only 8
fields, while another might require all, etc.

I'm trying to make this easy by having only one form instead of a
seperate form for each analysis type. What is the best way to go
about this? In a query? Form properties? Also, I'm not familiar
with writing code at all...so for direction I use macros.
 
J

Jeff Boyce

Chris

I may not be visualizing your situation correctly...

It sounds like you want the user to pick one of six "Analysis Type"s, then
fill in the appropriate fields (disabling the inappropriate ones).

You could create a form with a combobox with the Analysis Types, and in the
combobox's AfterUpdate event, set the .Enabled property for the fields on
the form.

By the way, if you are saying that your table has a large number of fields
that will NOT be used, depending on the choice of Analysis Type, the table
sounds more like a spreadsheet than an Access table ... and this is not a
good thing! Consider posting a description of the table, something like:

tblPerson
PersonID
LastName
FirstName
MiddleName
Suffix
DOB
...

and a description of the contents of the fields, if the fieldname doesn't
clarify.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

Chris

Chris

I may not be visualizing your situation correctly...

It sounds like you want the user to pick one of six "Analysis Type"s, then
fill in the appropriate fields (disabling the inappropriate ones).

You could create a form with a combobox with the Analysis Types, and in the
combobox's AfterUpdate event, set the .Enabled property for the fields on
the form.

By the way, if you are saying that your table has a large number of fields
that will NOT be used, depending on the choice of Analysis Type, the table
sounds more like a spreadsheet than an Access table ... and this is not a
good thing! Consider posting a description of the table, something like:

tblPerson
PersonID
LastName
FirstName
MiddleName
Suffix
DOB
...

and a description of the contents of the fields, if the fieldname doesn't
clarify.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Thanks a lot, Jeff. I think you seem to understand what it is I am
trying to do, and I like the idea of your suggestion. I'll certainly
give it a try. Thanks!
 

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

Top