How to personalize messages from system? Or disable it

M

Marco

Hi. I have a form. That form allows me to insert appointment. I canonly make
one appoitment for each person. So my relationship is one to one.

Anytime I tried to insert more then one appointment per day it returnes a
error message from system. I have my one message, but the message system
keeps returning. What/how can I disable this message from system?

Regards,
Marco
 
M

Marco

Weel it's to big. I I can resume it: "There's an violation intigrity due a
primary key. do you want to run the macro anyway?"

This happens because I told to access that I cannot have to appoitments in
the same day. So I have a primary key in the employee code and another in
date. I just want to avoid the system warnings and put my own messages.

Regards,
Marco
 
R

ruralguy via AccessMonster.com

It is probably error number 3022 and implimenting error handling would solve
your problem but I don't think you can do that with Macro's.
Weel it's to big. I I can resume it: "There's an violation intigrity due a
primary key. do you want to run the macro anyway?"

This happens because I told to access that I cannot have to appoitments in
the same day. So I have a primary key in the employee code and another in
date. I just want to avoid the system warnings and put my own messages.

Regards,
Marco
Care to share the error number and message with this forum?
[quoted text clipped - 7 lines]
 
M

Marco

Can you help me?

Marco


ruralguy via AccessMonster.com said:
It is probably error number 3022 and implimenting error handling would solve
your problem but I don't think you can do that with Macro's.
Weel it's to big. I I can resume it: "There's an violation intigrity due a
primary key. do you want to run the macro anyway?"

This happens because I told to access that I cannot have to appoitments in
the same day. So I have a primary key in the employee code and another in
date. I just want to avoid the system warnings and put my own messages.

Regards,
Marco
Care to share the error number and message with this forum?
[quoted text clipped - 7 lines]
Regards,
Marco
 
R

ruralguy via AccessMonster.com

I'm afraid you will need to wait for someone who is more familiar with
macro's. Sorry.
Can you help me?

Marco
It is probably error number 3022 and implimenting error handling would solve
your problem but I don't think you can do that with Macro's.
[quoted text clipped - 14 lines]
 
F

fredg

Hi. I have a form. That form allows me to insert appointment. I canonly make
one appoitment for each person. So my relationship is one to one.

Anytime I tried to insert more then one appointment per day it returnes a
error message from system. I have my one message, but the message system
keeps returning. What/how can I disable this message from system?

Regards,
Marco

You can use code to replace the system message with your own.

Here's how you can find the correct error and show your own message
for any of the form level errors.

First code the Form's Error event:

MsgBox "Error#: " & DataErr ' Display the error number
Response = acDataErrDisplay ' Display Default message

Then open the form and intentionally make that error.

The message box will display the error number and the default error
message.

Next, go back to the error event and change that code to:

If DataErr = XXXX Then
Response = acDataErrContinue ' Don't display the default message
MsgBox "Present your own message here."
Else
MsgBox "Error#: " & DataErr
Response = acDataErrDisplay ' Display Default message
End If

where XXXX is the error number.
 
Top