Index/PK Cannot Contain Null Value -only in form, not query

bsnalex

New Member
Joined
Jun 27, 2008
Messages
35
Now this is odd.

I'm hitting a hurdle on the first form in my DB. In the back end there's a bunch of tables, however all are connected via the field "RGID". It's the PK in the main registration table (patient name, dob, address, etc) and links 1-to-1 on the further tables (Diagnosis info, referral info, General Practitioner, Dentist, etc). The query I've built to create my registration form takes the registration table, and then brings in the fields from the further tables to fill in on the form.

Now, the registration form itself is located in a subform within the main registration form. My goal is to have the registration data on one Page (tab), then page 2 is surgical histroy, page 3 is appointment history, etc. The record filter for the subform (which contains the registration query) is therefore based on the active RGID within the main form.

The problem is this: I can update the records with no problem when running the query itself and manually typing in the data into the query. When I bring that query into the form, however, I receive the "Index or Primary Key Cannot Contain Null Value", after adding data to fields that would update the further tables mentioned above.

It's worth noting that in the back-end, all tables linked via the RGID field have referential integrity enforced.

Anyone got any ideas?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Before you can add subform data, you must save the primary parent record.
you cant add client surgeries, unless the CLIENT is saved. You may have data in the screen , but did not click the save (the pencil).
Once the pencil has turned to arrow. The record is saved and the clientID (autonumber?) will appear. NOW you can save subform data.
 
Upvote 0
Before you can add subform data, you must save the primary parent record.
you cant add client surgeries, unless the CLIENT is saved. You may have data in the screen , but did not click the save (the pencil).
Once the pencil has turned to arrow. The record is saved and the clientID (autonumber?) will appear. NOW you can save subform data.

The parent record was preexisting.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top