M
Mark Hollander
Hi All,
I have a form called supplier whose default view is set to single view and
it has a subform whose default view is set to continuous
Main form's table is supplier
Sub form's table is suppliernotes
The sub form is linked via a single field ID -> Supplier ID.
On the main form I have all the fields that are in the database supplier
(Please see database structures below). The subform has all the fields that
is in it's database
When running the main form, the record that the main form is on is saved to
the database, and I add a record to the subform the autonumber field is
automatically filled in as expected but the ID from the main form does not
populate the supplierid field and I get the following error when I try to
move of the field or save the record
"Index or Primary Key cannot contain a Null value".
I was under the impression that the SupplierId field would have been filled
in automatically by access when a child record is entered because it is the
link between the 2 tables.
Any help and/or suggestions would be appreciated
MS Access 2007
[SUPPLIER TABLE STRUCTURE]
ID AUTONUMBER PRIMARY KEY
COMPANY TEXT
.... LOT OF OTHER FIELDS PERTAINING TO CONTACT INFORMATION AND ADDRESS
[SUPPLIERNOTES TABLE STRUCTURE]
SUPPLIERID NUMBER PRIMARY KEY
LINEID AUTONUMBER PRIMARY KEY
NOTES MEMO
ATTACHMENT ATTACHMENT
ENTRYDATE DATE/TIME
[RELATIONSHIPS]
SUPPLIER -> SUPPLIERNOTES (ONE TO MANY)
ID SUPPLIERID
ENFORCE REFERENCIAL INTEGRITY CHECKED
CASCADE UPDATE RELATED FIELDS CHECKED
CASCADE DELETE RELATED FIELDS UNCHECKED
I have a form called supplier whose default view is set to single view and
it has a subform whose default view is set to continuous
Main form's table is supplier
Sub form's table is suppliernotes
The sub form is linked via a single field ID -> Supplier ID.
On the main form I have all the fields that are in the database supplier
(Please see database structures below). The subform has all the fields that
is in it's database
When running the main form, the record that the main form is on is saved to
the database, and I add a record to the subform the autonumber field is
automatically filled in as expected but the ID from the main form does not
populate the supplierid field and I get the following error when I try to
move of the field or save the record
"Index or Primary Key cannot contain a Null value".
I was under the impression that the SupplierId field would have been filled
in automatically by access when a child record is entered because it is the
link between the 2 tables.
Any help and/or suggestions would be appreciated
MS Access 2007
[SUPPLIER TABLE STRUCTURE]
ID AUTONUMBER PRIMARY KEY
COMPANY TEXT
.... LOT OF OTHER FIELDS PERTAINING TO CONTACT INFORMATION AND ADDRESS
[SUPPLIERNOTES TABLE STRUCTURE]
SUPPLIERID NUMBER PRIMARY KEY
LINEID AUTONUMBER PRIMARY KEY
NOTES MEMO
ATTACHMENT ATTACHMENT
ENTRYDATE DATE/TIME
[RELATIONSHIPS]
SUPPLIER -> SUPPLIERNOTES (ONE TO MANY)
ID SUPPLIERID
ENFORCE REFERENCIAL INTEGRITY CHECKED
CASCADE UPDATE RELATED FIELDS CHECKED
CASCADE DELETE RELATED FIELDS UNCHECKED