I am not to sure on how to get the msgbox to work however if you have space on your form, and would like to place a message there do this.
When I created something like this I created a label on my form, but did not type anything into it, instead I hit the spacebar 2 or 3 times and saved it that way. So when I looked at the form during runtime I would not see the label. Then I created a macro that on form load would goto a any textbox,(this is done because access will not let you create an if statement on a text box if the textbox does not have focus) once that textbox as the focus I went into the vb code and created an if statement that looks like this:
Private Sub MovName_GotFocus()
'Action that takes place if there is no records in the database
If MovName.Text = "" Then
Label1.ForeColor = 16737843(blue)
Label1.FontSize = 12
Label1.Caption = "Search completed"
Label42.Caption = "No records found with that name. Please click the 'Retry' button and check the spelling."
Label42.ForeColor = 255 (red)
Label42.FontSize = 12
Cmnd37.Caption = "Retry"
End If
End Sub
Now what happens is when I click on a button on my main menu that will open this query in form view I am asked to enter my data I want to search by, if my data is not correct the data base displays a message on one label (label1) that the "Search completed" and display a message on a second label (label42) that "No records found with that name. Plaeas check the spelling and click the retry button."
NOTE: The Retry button is a button that I placed on the form that most of the time when there are valid records displays a message "Search Again" but if the but using this if statement if there are no records on the first search then the button says "Retry".
I hope I could help you with your question.