Question MsgBox custom button with action

DanJames

Registered User.
Local time
Today, 12:32
Joined
Sep 3, 2009
Messages
78
Hi have this VBA for a MS Access Form, and would like to have 2 custom buttons.

Code:
Private Sub Form_Load()
nRecords = DCount("*", "ClientsNoCleaner")
If nRecords >= 1 Then
MsgBox "You have " & nRecords & " Clients with no Cleaner assigned.  Click 'View these Clients' or 'Ignore' below.", vbInformation, "Message"
Text21.Value = "You have " & nRecords & " Clients with NO Cleaner assigned.  Click 'View these Clients' below to resolve the problem."
Else
Text21.Value = "All Clients on the database have a cleaner assigned."
End If
cRecords = DCount("*", "CleanersNoClient")
If nRecords >= 1 Then
MsgBox "You have " & cRecords & " Cleaners with no Client assigned.  Click 'View these Cleaners' or 'Ignore' below.", vbInformation, "Message"
Text19.Value = "You have " & cRecords & " Cleaners with NO Clients assigned.  Click 'View these Cleaners' below to resolve the problem."
Else
Text19.Value = "All Cleaners on the database have a client assigned."
End If
End Sub

I would like it to have a button saying 'View these Clients' with the action of opening a form, and an 'Ignore' button' just as OK action.

Thanks in advance.
 
Then you need to build yourself a form and use it instead. You can open it and use WindowMode:=acDialog to act like a Message Box where nothing happens until you click it.
 
OK, I won't do that, it doesn't matter anyway.
 

Users who are viewing this thread

Back
Top Bottom