• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

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?
0
compuzak1
Asked:
compuzak1
  • 3
  • 2
2 Solutions
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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
 
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 ArchitectCommented:
"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 ArchitectCommented:
Yeah ... it is cool ... and FAST, no matter how many controls.

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

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now