Msg Box

  • Thread starter Thread starter CM
  • Start date Start date
C

CM

How do I make a Msgbox appear on a form, which will give message "AAAAAA" if
the checkbox is ticked and message "BBBBBBBB" if it is unticked?

Any help would be appreciated.

Thanks

Colin
 
Hi Colin

this is the code you need

If Me.Check297.Value = yes Then
MsgBox "AAAAA"
Else
MsgBox "BBBB"
End If


where check297 is your checkbox name
now its up to you where you want tp past this code, you can try it in the
checkbox after update event for testing

Regards

Samer
 
Put code in the checkbox's AfterUpdate eventhandler along
the lines of
if {yourcheckboxname} Then
msgbox "AAAAAA"
else
msgbox "BBBBBB"
end if

Hope That Helps
Gerald Stanley MCSD
 
The MsgBox function has several optional parameters, but
its most basic version displays a message and an OK
button. If that's what you need, then the following code
will work:

Dim strMsg As String
If <YourCheckBoxName> = True Then
strMsg = "AAAAAAA" Else
strMsg = "BBBBBBB"
End If
MsgBox(strMsg)

See Visual Basic Help for other parameters of the MsgBox
function. (<Ctrl-G> to access VB, then choose its Help)

HTH
Kevin Sprinkel
 
Just another simple question....

How do I add a title to this, to display on the msgbox instead of Microdoft
Access ?

I have tried Title " " but it doesn't work

Thanks in advance!

Colin
 
CM said:
Just another simple question....

How do I add a title to this, to display on the msgbox instead of Microdoft
Access ?

I have tried Title " " but it doesn't work

MsgBox "AAAAAAA", vbOKOnly, "This is the Title"
 
Back
Top