T
Thomas Schoberl
Hello all,
I was wondering if this was possible. I am trying to create a message box
vbOKOnly with a message in the line. I have a table with a list of
"Affirmations" in it, and a randomizing query based on it. What I need is
for a random message to appear from the table in the text line of the message
box. Below is my VBA coding that I have been attempting, but I cant seem to
see what the issue is. Any help would be greatly appreciated.
Private Sub Command32_Click()
On Error GoTo Err_Command32_Click
Dim rand As String
rand = "SELECT TOP 1 Affirmations.* FROM Affirmations " _
& "ORDER BY rnd(isnull(Affirmations.Affirmation) * 0 + 1);"
MsgBox rand, vbOKOnly, Affirmation
Exit_Command32_Click:
Exit Sub
Err_Command32_Click:
MsgBox Err.Description
Resume Exit_Command32_Click
End Sub
I was wondering if this was possible. I am trying to create a message box
vbOKOnly with a message in the line. I have a table with a list of
"Affirmations" in it, and a randomizing query based on it. What I need is
for a random message to appear from the table in the text line of the message
box. Below is my VBA coding that I have been attempting, but I cant seem to
see what the issue is. Any help would be greatly appreciated.
Private Sub Command32_Click()
On Error GoTo Err_Command32_Click
Dim rand As String
rand = "SELECT TOP 1 Affirmations.* FROM Affirmations " _
& "ORDER BY rnd(isnull(Affirmations.Affirmation) * 0 + 1);"
MsgBox rand, vbOKOnly, Affirmation
Exit_Command32_Click:
Exit Sub
Err_Command32_Click:
MsgBox Err.Description
Resume Exit_Command32_Click
End Sub