null value- problem with adding a record

dbse uploaded
go to form called clients
go to first tab called main detaills

when i add A new record in the main details tab I get the error message "you tried to assign a null value to a variable that is not a variant data type."
However once i get rid of that message I can continue to add the record...

But thats not right obviously. What is wrong!
current-2-.accdb
topUKlawyerAsked:
Who is Participating?
 
als315Commented:
I don't really understand why you like to have subform if it is using same table as main form.
Add clientID to subform and you will see more interesting error message.
You are filtering subform with this ID, but it does not exists for new record.
May be you can put all these fieds to main form without subform?
0
 
als315Commented:
May be this way
current-2-.accdb
0
 
Jeffrey CoachmanMIS LiasonCommented:
<I don't really understand why you like to have subform if it is using same table as main form.>

Yes, Can you first take a step back and explain your design please?

Your Relationships are very confusing...

...but first see if als315's sample solves your issue.
0
 
dqmqCommented:
Agree.  Linked subforms are intended for a parent child relationship, but that is not what you have. In your case, both the form and subform have the same record source.  When you add a new client, the child recordsource gets confused on the autonumber column.

Solution 1:  eliminate the subform
Solution 2:  eliminate the autonumber
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.