L
Lance
Hello,
I am hoping to get some help on trapping this error, or finding a
workaround to avoid it.
I am getting the error "You tried to assign the Null value to a
variable that is not a Variant Data Type" when working in a subform
with the following setup.
I have a main form and a subform. The mainform pulls values from a
table called tblPrograms, of which the linking value is ProID. The
subform's job is to assign clients to the program (a one to many
relationship between clients and programs). ClientID is a primary key,
with no duplicates allowed on the form.
In the subform, the user is presented with only one combo box asking
them to select a user to add to the program. However, if a user selects
a name, and then decides they don't want to add that name, and deletes
the value from the combo box, the above error occurs. Obviously, they
have created a record, deleted the value, and have now left a null
value in a key field. My goal is to trap this problem before it
happens, but I am not sure how to approach it.
I have thought to put code in the "before update" of the combo box, but
that code does not trigger prior to the error generated automatically
by access.
Any ideas are greatly appreciated.
I am hoping to get some help on trapping this error, or finding a
workaround to avoid it.
I am getting the error "You tried to assign the Null value to a
variable that is not a Variant Data Type" when working in a subform
with the following setup.
I have a main form and a subform. The mainform pulls values from a
table called tblPrograms, of which the linking value is ProID. The
subform's job is to assign clients to the program (a one to many
relationship between clients and programs). ClientID is a primary key,
with no duplicates allowed on the form.
In the subform, the user is presented with only one combo box asking
them to select a user to add to the program. However, if a user selects
a name, and then decides they don't want to add that name, and deletes
the value from the combo box, the above error occurs. Obviously, they
have created a record, deleted the value, and have now left a null
value in a key field. My goal is to trap this problem before it
happens, but I am not sure how to approach it.
I have thought to put code in the "before update" of the combo box, but
that code does not trigger prior to the error generated automatically
by access.
Any ideas are greatly appreciated.