Null Value Error

G

Guest

Hello,

I am getting this error in one of my notes subform. "You tried to assign the
null value to a variable that is not a variant data type." I click ok and
then I get this error. "The field 'solicitations.contactID' cannot contain a
null value because the required property for this field is set to true. Enter
a value in this field." I use this subform to enter notes. I have the table
set to memo, required = no and indexed = no. I have been running database
for a couple of months without any problem until now. Can anyone help me? I
am new to Access and would appreciate any help. Thanks.

Mark
 
R

Rick Brandt

Mark said:
Hello,

I am getting this error in one of my notes subform. "You tried to
assign the null value to a variable that is not a variant data type."
I click ok and then I get this error. "The field
'solicitations.contactID' cannot contain a null value because the
required property for this field is set to true. Enter a value in
this field." I use this subform to enter notes. I have the table
set to memo, required = no and indexed = no. I have been running
database for a couple of months without any problem until now. Can
anyone help me? I am new to Access and would appreciate any help.
Thanks.

Mark

Are you perhaps entering a subform record for which you haven't yet created a
record in the parent form?
 
G

Guest

Hi Rick,

Thanks for responding. The way I have my database setup is a form with a
subform for the notes. I enter the data on the form, such as date,
solicitation #, qty, and dollar value. Sometimes I need to enter a special
note for that record. But I do this while I am filling out the record for
the first time. I just tab over. I looked at your suggestion and filled out
the record with new information and advanced to the next record then went
back to the record and filled in the special note and it worked. My new
question is, is there a way to allow me to fill in the new record and notes
without having to save the record first? Thanks for your help'

Mark
 
R

Rick Brandt

Mark said:
Hi Rick,

Thanks for responding. The way I have my database setup is a form
with a subform for the notes. I enter the data on the form, such as
date, solicitation #, qty, and dollar value. Sometimes I need to
enter a special note for that record. But I do this while I am
filling out the record for the first time. I just tab over. I
looked at your suggestion and filled out the record with new
information and advanced to the next record then went back to the
record and filled in the special note and it worked. My new question
is, is there a way to allow me to fill in the new record and notes
without having to save the record first? Thanks for your help'

That should happen automatically as you move from the main form to the
subform. What I was talking about is if you try to enter the data in the
subform first, before you have entered the data for the main form. You
cannot do that since the subform needs to inherit the values for the linking
fields in the parent record. If you haven't yet created a parent record
then those linking fields will be null in the sub-record and since those are
almost always required fields you get the error.

To clarify this sequence should work...

1) Navigate to new record in parent form.
2) Enter data for main record
3) Move focus to subform
4) Enter data for one or more child records.
 

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