Hello everyone,
is there a possibility to close a form that is in dialog box style by code?
does not work. I am afraid that I can´t do anything by code until the user closes the form, right? Is there no way around, maybe by addressing the vbFormControlMenu?
I have a query´s result displayed in a form. If the query is empty, I want the form to be closed and a message to be shown.
When my query output form is in AcWindowNormal mode, it works. But then my other open forms are restored down and I want them to stay maximized, that´s why I chose the dialog box.
Here is my code:
Does anyone have an idea?
I would also be happy to make my form normal window style, if there is a possibility to leave the other forms maximized on closing it.
Regards,
moori
is there a possibility to close a form that is in dialog box style by code?
Code:
DoCmd.Close acForm, "frmQuery"
I have a query´s result displayed in a form. If the query is empty, I want the form to be closed and a message to be shown.
When my query output form is in AcWindowNormal mode, it works. But then my other open forms are restored down and I want them to stay maximized, that´s why I chose the dialog box.
Here is my code:
Code:
DoCmd.OpenForm "frmQuery", acNormal, , , acFormPropertySettings, acDialog
' If Query is empty, close Query Window and show Dialog Box with Message
If DCount("*", "Query") = 0 Then
' HERE SOMEHOW CLOSE FORM "frmQuery"
MsgBox "Query empty!"
Exit Sub
End If
I would also be happy to make my form normal window style, if there is a possibility to leave the other forms maximized on closing it.
Regards,
moori