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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a form and do a command on that open form 1

Status
Not open for further replies.

soldieryap

Programmer
Aug 15, 2000
59
MY
how if i want to open a form and do a command in that form.(not the current form)

in the current form, i have a button that opening the other form, but when i disable a Text Box in another form, it won't work.

it's like this:
DoCmd.OpenForm "Game"
Forms![Game].Name.enabled=true

thanks
 
You've got the right idea, but your example is bad. "Forms![Game].Name.enabled=true" would be attempting to set the Enabled property of the Name property of the Game form. But the Name property is a string; it doesn't have an Enabled (or any other) property.

If you wanted to enable the form, you would use:
Forms![Game].Enabled = True Rick Sprague
 
sorry, i think i have give you the wrong idea .....

actually, i want to set the "Name"(text box) in the Forms![Game] to enabled=true, because i have set it to enabled=false, so how's about that? i want to enable that text box if i open that form from another form .
 
Ah! Now I understand. You still had it almost right:
Forms![Game]!Name.Enabled = True

That's a "shorthand" version of this more complete statement:
Forms!Game.Controls!Name.Enabled = True

(BTW, you don't have to use "[" and "]" unless the name between them has a space in it.) Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top