Dim Out (2) Controls of Form

  • Thread starter Gulf Coast Electric
  • 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
 
D

Dirk Goldgar

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.
 

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