Cannot copy data from cbo into main table

S

SJW123

I have a database tracking tasks in our office - tblTasks. I am using a cbo
to populate the Field: Allocated Person on tblTasks, with the named person
responsible for the task. tblAllocated is linked to tblTasks via TasksID.
When I enter new data into Allocated Person field (via cbo), a message box
asks whether I wish to add new entry, as expected. When I click yes, I get
'Run-time Error 3201. Cannot add new or change a record because a related
record is required in tblTask'. Also, I know the AllocationID should be saved
into tblTask, but no data is being copied into the main table (tblTask)
I hope this makes sense and thanks for any help
steven
 
L

Larry Linson

If you have set a Relationship, and specified Referential Integrity, no
Record on the many side of the Relationship can be written if there is no
corresponding Record on the one side. That seems to be what you have
encountered -- you want to write the "related record" before you write the
"master record", and it just doesn't work that way. You can do an explicit
save of the Record on the Form, by setting Me.Dirty = False.

Larry Linson
Microsoft Access MVP
 
S

SJW123

Thanks Larry. Yes, that is the problem I am encountering. Can you explain
where exactly what I should do with Me.Dirty = False ie. your last sentence
thanks
 
Top