- Local time
- Today, 23:28
- Joined
- Sep 12, 2006
- Messages
- 16,030
I prefer not to use dialog mode with forms. I like sizeable and movable forms, and in many of my apps, I save form sizes and positions, so that uses can get the interface looking how they want.
So here is an alternative
open form with this code. Access will now wait for the form to close before continuing - which is the the same as dialog mode, but you now have a "normal" form appearance
now the trouble is, there is no isopen function in vba - so this does the job.
note that you can use this idea with a query, or a report also
So here is an alternative
open form with this code. Access will now wait for the form to close before continuing - which is the the same as dialog mode, but you now have a "normal" form appearance
Code:
docmd.openform "myform"
while isopen("myform")
doevents
wend
.... waits for form to close
.... program execution continues
now the trouble is, there is no isopen function in vba - so this does the job.
Code:
Function IsOpen(strName As String, Optional objtype As Integer = acForm)
IsOpen = (SysCmd(acSysCmdGetObjectState, objtype, strName) <> 0)
End Function
note that you can use this idea with a query, or a report also
Code:
docmd.openform "myreport"
while isopen("myreport",acreport)
doevents
wend
Last edited: