"pulling" info from the Main form to a subform

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi! I have been wrestling with this for quite sometime and
I hope ya'll can help (as you have in the past).

Background info:
The database I'm working on is similar to the Northwind
sample database. The Main form has 2 subforms (only
subform#1 is causing a problem), both are 'linked' to the
Main form via Master/Child fields of the OrderID number.


Problem:
Subform #1 is a product entry form and the OrderID number
is not showing in the Subform#1. It works for a single
product, and it is required to have more than one product
per orderID#. Anything more than 1 product and I get an
error: "Index or primary key cannot contain a null value".
This is probably due to the blank in the OrderID slot.

I've tried various codes, that may or maynot be coded
correctly, to try and obtain the OrderID number from the
main form into the subform OrderID space. Can anyone help
with this problem? Thanks!
sam
 
-----Original Message-----
Hi! I have been wrestling with this for quite sometime and
I hope ya'll can help (as you have in the past).

Background info:
The database I'm working on is similar to the Northwind
sample database. The Main form has 2 subforms (only
subform#1 is causing a problem), both are 'linked' to the
Main form via Master/Child fields of the OrderID number.


Problem:
Subform #1 is a product entry form and the OrderID number
is not showing in the Subform#1. It works for a single
product, and it is required to have more than one product
per orderID#. Anything more than 1 product and I get an
error: "Index or primary key cannot contain a null value".
This is probably due to the blank in the OrderID slot.

I've tried various codes, that may or maynot be coded
correctly, to try and obtain the OrderID number from the
main form into the subform OrderID space. Can anyone help
with this problem? Thanks!
sam
.
Hi Sam, just from the details above I suspect the you have
another field(s) in the subform recordsource that is a
linking field (foreign key). If 'yes' then ensure that this
(these) field(s) has a value when a record is created.

Luck
Jonathan.
 
Back
Top