T
tom
I have designed a form to be used by data entry person. I want to
eliminate the standard menu navigation buttons. I have created a
Close button that will close the form and thus save the record. The
date field is indexed with no duplicates so that a duplicate date
can't be entered. Here is the code in the Unload Event of the form:
If DCount("[IndexedFieldName]", "TableName") > 1 then MsgBox "Indexed
Field name is a duplicate. Change the value." Cancel = True
Me![IndexedFieldname].SetFocus End If
When a duplicate date is entered and the Close button is clicked the
Msg Box does pop up. However when the "ok" button inside the message
box is clicked it generates a run-time error 2169.
Is there another way to accomplish this? What am I doing wrong? Any
help is appreciated.
eliminate the standard menu navigation buttons. I have created a
Close button that will close the form and thus save the record. The
date field is indexed with no duplicates so that a duplicate date
can't be entered. Here is the code in the Unload Event of the form:
If DCount("[IndexedFieldName]", "TableName") > 1 then MsgBox "Indexed
Field name is a duplicate. Change the value." Cancel = True
Me![IndexedFieldname].SetFocus End If
When a duplicate date is entered and the Close button is clicked the
Msg Box does pop up. However when the "ok" button inside the message
box is clicked it generates a run-time error 2169.
Is there another way to accomplish this? What am I doing wrong? Any
help is appreciated.