Using subform to add new record to a table giving null type to variant error (1 Viewer)

mh123

Registered User.
Local time
Today, 00:22
Joined
Feb 26, 2014
Messages
64
Hi all

Been a while since I have posted here but this has had me at my wits end and I can not figure out why. I've searched for ages on google and here and haven't found an answer - I am rather tired and I am hoping it's something so simple I will be able to laugh at it in the morning.

The problem;

I have a form (based on tblPerformances) which then has 4 subforms in it (each one linked via idPerformance which is the PK of master) and everything works dandy as it should......until I am on a 'new record' where idPerformance shows as 'new'. At this stage, once I go to populate the 'new' record with something from one of the subforms it will give me the error 'You tried to assign the Null value to a variable that is not a Variant data type'. Upon throwing this error at me, the table has been updated with the extra record and upon a 'refresh all' the row is in the table and I can then flick back to it and edit it as usual....!?! But I have no idea why it's throwing that at me only when the first bit of data on the new master's record comes from the subform.

I can post a copy of the db tomorrow if necessary but I am hoping someone in here will be able to point out a grave error I have made somewhere which will fix it.

Many thanks,
Mark
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 00:22
Joined
Jul 9, 2003
Messages
16,282
You will have to add a record to the main form before you can add records to the sub forms.
 

Users who are viewing this thread

Top Bottom