MyMsgBox




Public Function myDialog() As Integer
DoCmd.OpenForm "myDialogBox", acNormal, , , , acDialog
' 'myDialog = Forms![myDialogBox].glrInt

Select Case glrint
Case 1
Debug.Print glrint
Case 2
Debug.Print glrint
Case 3
Debug.Print glrint
Case 4
Debug.Print glrint
Case 5
Debug.Print "bye"
' 'DoCmd.Close acForm, "myDialogBox", acSaveNo

Case Else
' '

End Select
myDialog = glrint
End Function

'create a from, remove all the recordselector, max, min, close stuff, so

'that it looks like a dialog box.

'Put five buttons (one more for cancel)

'on the click event of each button put code like this:


Private Sub cmdYes_Click()
glrint = 1
DoCmd.Close acForm, "mydialogbox"
End Sub

'I created subs for each button and each sub returns 1or 2 or 3 or 4 or 5.

' seems to work if you call

x = mydialog()
if x = 1 then
dosomething.... .....
In a module, create a global variable glrInt as integer
create a function











( mymsgbox.html )- by Paolo Puglisi - Modifica del 17/12/2023