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

DoMenuItem

Status
Not open for further replies.

Informatic

Programmer
Oct 4, 2002
34
DE
I have used the following VBA Code to find a record in a form :

DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Can i ask with VBA Code if the DoMenuItem form is closed be the user or still not.

Help...
 
Informatic,

You would need to this:
Code:
Dim frm As Form
Dim frmIsOpen As Boolean

For Each frm in Forms
    If frm.Name = "MyFormsName" Then frmIsOpen = True
Next frm

If frmIsOpen = True Then
    '<List of commands if form is already open>
Else
    '<List of commands if form is closed>
End If

You will need to change MyFormsName to the actual name of your form. Then you would just need to replace the two sections in the If...Then statement to whatever you like. God Bless,
Mike

Yes, I believe in Jesus. ;-)
&quot;Neither is there salvation in any other: for there is none other name under heaven given among men, whereby we must be saved.&quot; (Acts 4:12, KJV)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top