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

Switching between acNormal and acDesign

Status
Not open for further replies.

awingnut

Programmer
Feb 24, 2003
759
US
I'm having a problem adding a control to a form because I cannot seem to open it in design view. I am trying to dynamically add labels to a form that is open. What I want is to reopen the form in design view, add the label control, then open in normal view.

I have to do this without closing the form because this is happening in the 'Open' event for that form. The statement 'Docmd.OpenForm(Me.Name,acDesign)' gives me a compile error saying '=' expected. Can someone point me in the right direction for doing this? TIA.

 
Hi,

You are getting the error becase you have bracketed the condition.

You should use...

Docmd.OpenForm Me.Name,acDesign

This still won't allow you to do what you want to do, as far as I'm aware you can't change the current view (hopefully someone will correct me if I'm wrong).
You will need to open the form from another form or module in design view and then add the controls.





There are two ways to write error-free programs; only the third one works.
 
Thanks for the reply. I get the same error even without the (). However, it seems the matter is moot since I can't do what I want. I'll have to look for an alternative method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top