From: Hallgeir on
I have a combobox bound to a field where the Required property is set to
True. When I delete value in combobox field and press enter I get a system
message telling me that I need to have a value in that table and that
tablefieldname. I understand that this state requires a message but is it
possible to supress the system message and instead write my own? And how
could that be done. Appreciate any tips.

regards Hallgeir
From: Jeanette Cunningham on
Keep in mind that I don't know anything about your tables, relationships and
database when reading the answer below.
It may be easier if you change the table properties for that field in the
table.
Instead of Required = Yes,
Use a validation rule of Is Not Null.

You can usually use the before update event of the form to check for null
values and ask the user to make an entry for those fields.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Hallgeir" <Hallgeir(a)discussions.microsoft.com> wrote in message
news:B136E89E-7093-41DB-AEE0-62C44EBEDDFE(a)microsoft.com...
>I have a combobox bound to a field where the Required property is set to
> True. When I delete value in combobox field and press enter I get a system
> message telling me that I need to have a value in that table and that
> tablefieldname. I understand that this state requires a message but is it
> possible to supress the system message and instead write my own? And how
> could that be done. Appreciate any tips.
>
> regards Hallgeir


From: Linq Adams via AccessMonster.com on
"I understand that this state requires a message but is it possible to
supress the system message and instead write my own? And how could that be
done. "

Sure it's possible! You can use the Form_Error event. Here's an example for a
single error, in this case the one you cited.

Private Sub Form_Error(DataErr As Integer, Response As Integer)

Select Case DataErr

Case 3314
MsgBox "your error message goes here"
Resonse = acDataErrContinue

Case Else
MsgBox Err.Number & " - " & Err.Description

End Select

Resonse = acDataErrContinue

End Sub

This code can be expanded to include other errors, and can even be modified
to pop up different messages for the same error, reflecting the actual
control that caused the error..

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

From: Linq Adams via AccessMonster.com on
"I understand that this state requires a message but is it possible to
supress the system message and instead write my own? And how could that be
done. "

Sure it's possible! You can use the Form_Error event. Here's an example for a
single error, in this case the one you cited.

Private Sub Form_Error(DataErr As Integer, Response As Integer)

Select Case DataErr

Case 3314
MsgBox "your error message goes here"
Resonse = acDataErrContinue

Case Else
MsgBox Err.Number & " - " & Err.Description

End Select

Resonse = acDataErrContinue

End Sub

This code can be expanded to include other errors, and can even be modified
to pop up different messages for the same error, reflecting the actual
control that caused the error.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

From: Linq Adams via AccessMonster.com on
Sorry for the double post! The gremlins be about tonight! Probably heard
about the newsgroup being abandoned by Mother Gates!

Actually, when I clicked on the "Post" button I got a popup asking how I
wanted to open the such and such file!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201006/1

 | 
Pages: 1
Prev: Help with Relationships please
Next: Syntex Error