
October 25th, 2006, 07:10 AM
|
 |
Moderator
|
|
Join Date: Mar 2006
Location: South Wales
|
|
Quote: | Originally Posted by novice123 hi, im usng ms access, to create a basic db. im trying to create a custom message appear instead of the default access one. i've got validations so that if the address line is left blank it wont add and show this error. the code is given below, ne help would be appreciated.
Code:
Private Sub AddClient_Click()
On Error GoTo Err_AddClient_Click
DoCmd.GoToRecord , , acNewRec
Exit_AddClient_Click:
Exit Sub
Err_AddClient_Click:
MsgBox Err.Description
Resume Exit_AddClient_Click
End Sub
|
I guess what the OP means is that he wants to know how to create a nicer looking messagebox instead of the default gray one.
You could add another UserForm to your project and design it how you want, then, instead of displaying a MsgBox you could open up the UserForm. In order to get the message to display you would have to declare a Global variable and set it equal to the Err.Description, that way you can access it from the new form.
|