Marshall Brooks
Member
- Local time
- Today, 17:32
- Joined
- Feb 28, 2023
- Messages
- 727
In my switchboard and elsewhere in the database, I open forms like this:
DoCmd.OpenForm "frmFormA", acNormal, "", "", , acNormal
If the form is already open, Access seems to select it automatically.
Is there any drawback to doing this as opposed to something like:
The one line solution is simpler, but I didn't know if there were any disadvantages to telling Access to open a form that was open already?
DoCmd.OpenForm "frmFormA", acNormal, "", "", , acNormal
If the form is already open, Access seems to select it automatically.
Is there any drawback to doing this as opposed to something like:
Code:
If SysCmd(acSysCmdGetObjectState, acForm, "frmFormA") <> 0 Then ' if FormA is open
forms("frmFormA").setfocus
Else
DoCmd.OpenForm "frmFormA", acNormal, "", "", , acNormal
End if
The one line solution is simpler, but I didn't know if there were any disadvantages to telling Access to open a form that was open already?