Firstly apologies for the convoluted question. I found this problem whilst
building a larger database. I've distilled it down to as small as possible
and can send a 200k example to anyone who has the time to have a play.
Am I doing something silly or is this an Access problem (or other)?
Access 2000
3 tables
tblID contains ID (autonumber), Data (text)
tbl1 contains ID (Number, default = nothing, Primary Key), bool1 (yes/no)
tbl2 contains ID (Number, default = nothing, Primary Key), bool2 (yes/no)
1 Query
SELECT tblID.*, tbl2.*, tbl1.*
FROM (tblID LEFT JOIN tbl2 ON [tblID].[ID]=[tbl2].[ID]) LEFT JOIN tbl1 ON
[tblID].[ID]=[tbl1].[ID];
2 forms based on this query:
FormOK - Field list used to drag and drop: tblID.ID, Data, bool1, bool2
(Default Value =False)
Allows data to be entered fine.
FormNoGo
Same as formOK but with bool1 Default Value =False as well.
Attempting to add a new record gives:
"Index or Primary Key cannot contain a Null Value"
I can see from the form that the ID field isn't null - it's autonumbering as
expected when text is entered in the data textBox.
I don't usually use bound forms so maybe I've taken the wrong approach
entirely.
Anyone shed any light?
Ian D
- return address spamtrapped but working if you do the obvious