Custom Msgbox

TractorMike

New member
Local time
Today, 13:33
Joined
Feb 25, 2011
Messages
2
Hello, I am trying to build a custom message box so that I can have a little more functionality that the msgbox function of VBA. My problem is coming when I call the form to open, the execution of the code does not stop. I have a form named "FRM_Message" which is opened when the database is opened and then hidden.

Here is the Function that I have built, hopefully someone can help me find out why it will not pause the code until the form is hidden again even though it is opened as acDialog.

Forms("FRM_Message").Caption = ScreenCaption
Forms("FRM_Message").lblTitle.Caption = Title
Forms("FRM_Message").lblMessage.Caption = Message


Select Case NumButtons
Case 1
With Forms("FRM_Message")
.cmdOK.Visible = True
.cmdNo.Visible = False
.cmdYes.Visible = False
End With
Case 2
With Forms("FRM_Message")
.cmdOK.Visible = False
.cmdNo.Visible = True
.cmdYes.Visible = True
End With
Case 3
With Forms("FRM_Message")
.cmdOK.Visible = True
.cmdNo.Visible = True
.cmdYes.Visible = True
End With
End Select

DoCmd.OpenForm "FRM_Message", , , , , acDialog

MsgBox "This should not appear until FRM_message is Hidden"
 
It appears like the form is already open (I don't think you can change those settings unless it is). That might make it ignore the OpenForm line. Try closing it first.
 
That seems to have done it. Thanks
 
No problemo, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom