Two Lines in A Message Box

ddrew

seasoned user
Local time
Today, 13:12
Joined
Jan 26, 2003
Messages
911
Is it possible to create a message box with two lines?

Also I want to make a reference to the valuein a text box in the message box.

This is my code at present:

If MsgBox("ARE YOU SURE YOU WANT TO DELETE THE WHOLE EXERCISE?", vbYesNo + vbQuestion, "Warning") = vbYes Then
CurrentDb.Execute "DELETE FROM ExerciseNametbl WHERE ExerciseName = " & Chr(34) & Me.ExerciseName & Chr(34), dbFailOnError
Me.ExerciseName.Requery
Else
Exit Sub
End If

What I would like is:

"Are you sure you want to delete (The value of comboExerciseName)"
 
msgbox

try,

msgbox "Are you sure you want to delete " & Me.ExerciseName

or
msgbox "Are you sure you want to delete " & ExerciseName

regards
ian
 
I'm not sure I understand your two lines question.

To reference the variable, do so like this:

If MsgBox("ARE YOU SURE YOU WANT TO DELETE " & ENTERVALUEHERE & "?",vbYesNo + vbQuestion, "Warning") = vbYes Then
 
To create a two line msg box:

msgbox "This is line one." & vbcrlf & "This is line two."
 

Users who are viewing this thread

Back
Top Bottom