Enabling / disabling fields on an access form

I have a form with a large number of fields.  I want to disable all the fields except for the key fields until the key fields are ALL populated.  I can manually enable/disable each field, but is there some looping mechanism I can use to expedite this task?  Also, where do I enable and disable the fields?
compuzak1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Add a tab control to your form with the following properties:

One Page (tab)
Style = None
Back Style = Transparent

Put all of the controls on this tab.
You can now enable / disable the tab control - and subsequently all controls on it with one line of code

Then, based on some condition:
Me.YourTabControlName.Enabled = True  ' False

This is VERY fast also.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
compuzak1Author Commented:
That will save a lot of time.

Do you put the key fields on another tab or just on the main screen?  or does it matter?

Also, when do you do the enable / disable?

Enable:  On exit of each key field ?
Disable:  On enter of each key field ?

Or is there a better place to enable / disable them?
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
"Do you put the key fields on another tab or just on the main screen?  or does it matter?"
Key fields?  You mean this text box that is unbound that we've been referring to?  If so, no ... not on the tab.  Maybe in the Header of the form.

"Also, when do you do the enable / disable?"
If the AfterUpdate event of the text box ... if text box is not null, enable ... if null (user backs out existing data), disable.

Initially when form opens, Tabs are disabled ... until valid data in entered into text box ...

mx
0
compuzak1Author Commented:
Thanks, this worked great.  Saved a lot of time and is very clean (minimal code).
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Yeah ... it is cool ... and FAST, no matter how many controls.

Do you see how to do the enabling/disabling ok ?

mx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.