Disabling Certain Fields on a Data Entry Form

Fritz24

Board Regular
Joined
Sep 8, 2004
Messages
102
I have a data entry form in a database and I'd like to make certain fields in the form unavailable depending on the criteria in one of the fields.

Example: In my company we have different systems used in different offices. My database stores employee details for people in all offices. Some of the details won't be relevant to certain people, but the data entry form shows all fields, relevant or not. I'd like to disable the irrelevant fields.

Something like: If [Location] = Nottingham Then (code to disable the irrelevant field would go here)

Hope that makes sense.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I've had to do something similar, and the best way I've found is to simply make the no-longer-required fields vanish.

So, something like (using your example and Systemname as one of the fields you want to hide):
Code:
If Location = Nottingham Then
Me.Systemname.Visible = False
This means that they won't even try to enter data in. You could also use (and I think this is right)
Code:
Me.Systemname.Locked = True
But if you use the second method and your staff are anything like ours, you'll get people asking you all the time why they can't enter data in those fields!! :rolleyes:

HTH...
 
Upvote 0
Glad to have been of assistance. I think it's the first time I've actually managed to help someone properly!!

I'm a real access newbie, so I feel a little less guilty about taking so much help while giving so little back now...! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,666
Members
449,114
Latest member
aides

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top