Dim Out (2) Controls of Form

  • Thread starter Thread starter Gulf Coast Electric
  • Start date Start date
G

Gulf Coast Electric

I use this code to open a Zip Code form that copies the City, State, Zip
onto (3) Different forms.
I want it when say the Customers form is open and the user opens the pop-up
form ZipCodes to just show the
Customers button, not the Vendors and Employees.
Also of course for the form Vendors and Employees.
The Vendors and Employees Command Buttons would be Dimmed out.
Customers is Command6 (Command Buttons)
Vendors is Command32
Employees is Command30
 
Gulf Coast Electric said:
I use this code to open a Zip Code form that copies the City, State,
Zip onto (3) Different forms.
I want it when say the Customers form is open and the user opens the
pop-up form ZipCodes to just show the
Customers button, not the Vendors and Employees.
Also of course for the form Vendors and Employees.
The Vendors and Employees Command Buttons would be Dimmed out.
Customers is Command6 (Command Buttons)
Vendors is Command32
Employees is Command30

What version of Access? If Access 2000 or later:

Command6.Enabled = CurrentProject.AllForms("Customers").IsLoaded
Command30.Enabled = CurrentProject.AllForms("Employees").IsLoaded
Command32.Enabled = CurrentProject.AllForms("Vendors").IsLoaded

If you're using Access 97, there's a function named "IsLoaded()" that
was distributed with the Northwinds or Solutions sample databases that
you can copy and use similarly -- or you could just do a quick search
for the code, which is widely posted.
 
Back
Top