Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling a form within a form

Status
Not open for further replies.

Travis33

Programmer
Nov 20, 2000
31
0
0
US
I have a database that I need to change the properties of command buttons based on the input of a user. I have a main form that pops up when the database is open and asks the user to enter a password. Based on that password the user will have rights to other forms. What code do I need to write to change the properties of buttons on different forms from my main form? the code I use for the buttons on my main form are me.command1.enabled = true that works but if I try to change the properties for buttons on other forms
it will not let me. How can I do this? Thank You so much

Travis
 
Your best bet is to set the command button properties on each form as they are opened(based on the logon criteria) using that form's Open or Load event procedure. Otherwise, each form must be open before the button properties can be changed using code triggered by any other event.

To address any control on another form(or report, including subforms) you need only use the full path to the control. For example, the following is the path to a text box on a form.

Forms!FormName!ControlName

For a control on a subform it would be:

Forms!MainFormName!SubFormName!ControlName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top