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

Opening a dialog box from a subform.

Status
Not open for further replies.

dotolee

Technical User
Jan 27, 2008
134
CA
I have the following code that works fine when the form is run as an independant form:

Private Sub cmdShowScript_Click()
DoCmd.OpenForm "frmBaselineSectionAScript", acNormal, , , , acDialog

End Sub

But if the form is embedded as a subform, this no longer works. Can u tell me why?
Please and thx
 
How are ya dotolee . . .

No reason why it shouldn't!

Your opening an independent form!

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
dotolee . . .

To be more clear . . . are you saying the form which executes your [blue]DoCmd.OpenForm[/blue] line doesn't execute that line when it resides as a subform on a mainform?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Sorry, I guess my post was poorly worded.
I have form 1. Form 1 has a button called "Show Script".
The code behind for this button is
Private Sub cmdShowScript_Click()
DoCmd.OpenForm "frmBaselineSectionAScript", acNormal, , , , acDialog

End Sub

The above code works fine when form 1 is run as an independant form. But when form 1 is embedded as a sub form, this code no longer works.
Thanks alot TheAceMan1!
 
dotolee . . .

Thats what I was asking. As long as you've spelled the form name correctly, your [blue]DoCmd.OpenForm[/blue] is perfectly legit . . .

Out of curiosity how did you incorperate the subform?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
hello theaceman1.
i was getting ready to prepare my response... decided to give it one more try to refresh my memory and now it's working. ???
my apologies for wasting your time. I dunno what I was doing wrong the other day.
thanks once again.
 
dotolee . . .

Ditto's on getting it working! . . . [blue]We can both sleep tonight . . .[/blue] [sleeping2]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top