Primary key help

G

Guest

I have a main form with with the Customer_Order table as the record source.
The Order_ID is the primary key. I have a subform with the RMA table as the
record source. The RMA_Num is the primary key. I had to make it the primary
key because if not when a new order was entered a second order was also
created but without any data in the RMA table. But since I have made the
RMA_Num a primary key I keep getting "Index or primary key cannot contain a
Null value." I keep clicking OK and filling out the form and it works fine
but I don't want the users to have to keep clicking OK. Any ideas on how to
fix this?

Thanks for any help.
 
J

John W. Vinson

I have a main form with with the Customer_Order table as the record source.
The Order_ID is the primary key. I have a subform with the RMA table as the
record source. The RMA_Num is the primary key. I had to make it the primary
key because if not when a new order was entered a second order was also
created but without any data in the RMA table. But since I have made the
RMA_Num a primary key I keep getting "Index or primary key cannot contain a
Null value." I keep clicking OK and filling out the form and it works fine
but I don't want the users to have to keep clicking OK. Any ideas on how to
fix this?

Thanks for any help.

Please explain what you mean by "when a new order was entered a second order
was also created"... this isn't clear to me!

Does the RMA table have the OrderID as a foreign key? How are you entering
data into the table - I'd suggest using the OrderID as the master/child link
field on a Subform? If each Order can have zero, one or more RMA records, then
the RMA_Num should be the primary key, but a separate OrderID would be a
(non-unique) foreign key. How does the RMA_Num get filled in?

John W. Vinson [MVP]
 
?

???

?????
John W. Vinson said:
Please explain what you mean by "when a new order was entered a second
order
was also created"... this isn't clear to me!

Does the RMA table have the OrderID as a foreign key? How are you entering
data into the table - I'd suggest using the OrderID as the master/child
link
field on a Subform? If each Order can have zero, one or more RMA records,
then
the RMA_Num should be the primary key, but a separate OrderID would be a
(non-unique) foreign key. How does the RMA_Num get filled in?

John W. Vinson [MVP]
 

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