Combobox and error 3314

H

Hallgeir

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
 
J

Jeanette Cunningham

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
 
L

Linq Adams via AccessMonster.com

"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..
 
L

Linq Adams via AccessMonster.com

"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.
 
L

Linq Adams via AccessMonster.com

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top