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

how to tell if a fom is Dialog

Status
Not open for further replies.

SuryaF

Programmer
May 21, 2006
100
DE
Heya,
I'm trying to see if a certain form was opened as vbDialog. I tried testing the Modal and the PopUp properties of the form but they are both false (the original settings).
Any ideas?
Thanks!
 
I'd add a openarg in the code then check it later
[tt]
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog, "Dialog"

DoCmd.OpenForm stDocName, , , stLinkCriteria, , , "Sizable"

[/tt]
later

[tt]
Private Sub Form_Open(Cancel As Integer)
MsgBox Me.OpenArgs
End Sub
[/tt]



________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Hi mp9, it doesn't work with the BorderStyle and MinMaxButtons either. Although the Help suggests all these properties it actually doesn't work, they have the orriginal values as set in the form's properties.

Thanks ZmrAbdulla, I thought about this but it's such a pain, I'll keep it as a final possibility.

Any other way that works?

Thanks a bunch!
 
Hehehe, I found the solution.

When using the acDialog WindowMode, the form will have the main Access windows assigned as its parent (instead of the MDI client window of Access). So....

Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long

Function IsPopup(frm As Form) As Boolean
Dim hWndParent as Long

hWndParent = GetParent(frm.hWnd)
IsPopup = (hWndParent = Application.hWndAccessApp)
End Function

This should work, I'll try it tomorrow. Thanks for your answers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top