D
Dan M
This one is a doozy. Nothing like bound forms, data
validations and errors.
Access XP adp file with SQL Server 2K back end.
.. I have a bound form with bound textboxes, 1 bound combo
box, and 2 unbound listboxes (providing the user with
helpful info).
.. Form recordsource is simply the table (not a SQL
statement or stored procedure).
.. Adding a new record.
.. First textbox accepts my entry fine.
.. Combo box has LimitToList set to true.
.. Also has NotInList event that catches user's new entry
and asks if they want it added.
.. If they say Yes, code uses ADO Command object to run an
insert SQL statement, putting the entry into the table.
.. If they say No, they are told to only pick an item from
the list.
.. Regardless of user's answer, if they delete their entry
in the combo box, then attempt to leave the combo box to
fill in other fields or use a listbox on the form to
gather more info first, the form's OnError event fires
with DataErr 3162 "Attempted to assign a Null value to a
variable that is not of Variant datatype."
.. If they DON'T delete their entry and try to move on, the
NotInList event fires again (of course).
.. Record has not been saved at this point.
.. The combo box will not release the focus.
.. If I use Response = acDataErrContinue, the focus is
locked on the combo box until they select from the list or
add an entry (unacceptable).
.. Without Response = acDataErrContinue, the provider's
error message is displayed (assign a null), which can be
confusing to the user.
.. Would like to avoid the form's OnError firing altogether.
.. Don't want to remove table/field based
definitions/validations (the field bound to the combo box
is non-nullable).
.. Don't want to have to manually verify everything entered
(that's what tables are for).
.. Don't want the trouble of an unbound form and having to
code all verifications.
.. Just want the combo box to allow user to begin their
entry, delete their partial entry, utilize other parts of
the form, then return to complete their entry.
Ice cream and cookies to the first with the right answer.
Thanks.
validations and errors.
Access XP adp file with SQL Server 2K back end.
.. I have a bound form with bound textboxes, 1 bound combo
box, and 2 unbound listboxes (providing the user with
helpful info).
.. Form recordsource is simply the table (not a SQL
statement or stored procedure).
.. Adding a new record.
.. First textbox accepts my entry fine.
.. Combo box has LimitToList set to true.
.. Also has NotInList event that catches user's new entry
and asks if they want it added.
.. If they say Yes, code uses ADO Command object to run an
insert SQL statement, putting the entry into the table.
.. If they say No, they are told to only pick an item from
the list.
.. Regardless of user's answer, if they delete their entry
in the combo box, then attempt to leave the combo box to
fill in other fields or use a listbox on the form to
gather more info first, the form's OnError event fires
with DataErr 3162 "Attempted to assign a Null value to a
variable that is not of Variant datatype."
.. If they DON'T delete their entry and try to move on, the
NotInList event fires again (of course).
.. Record has not been saved at this point.
.. The combo box will not release the focus.
.. If I use Response = acDataErrContinue, the focus is
locked on the combo box until they select from the list or
add an entry (unacceptable).
.. Without Response = acDataErrContinue, the provider's
error message is displayed (assign a null), which can be
confusing to the user.
.. Would like to avoid the form's OnError firing altogether.
.. Don't want to remove table/field based
definitions/validations (the field bound to the combo box
is non-nullable).
.. Don't want to have to manually verify everything entered
(that's what tables are for).
.. Don't want the trouble of an unbound form and having to
code all verifications.
.. Just want the combo box to allow user to begin their
entry, delete their partial entry, utilize other parts of
the form, then return to complete their entry.
Ice cream and cookies to the first with the right answer.
Thanks.