L
LaurieTuff via AccessMonster.com
I have a form which allows a user to add a new category to table [CPlan Type].
After update I then want to be able to add an additional record of that
category to a table called [CPlan Outcome] for each staff member.
I'm using the following code (Item holds the # of Staff members with their
ID#s in StaffIDArray()
Set RS = db.OpenRecordset("Cplan Outcome", dbOpenDynaset)
For Numb = 0 To Item
With RS
.AddNew
!StaffID = StaffIDArray(Numb)
!Category = NewCategory
!Outcome = ""
!Updated = Today 'CDate(Today)
!UpdatedBy = UpdatedBy
.Update
End With
Next Numb
RS.Close
I get error 3201, 'You cannot add or change a record because a related record
is required in table "CPlan Type"
How can I make this work??
Laurie
After update I then want to be able to add an additional record of that
category to a table called [CPlan Outcome] for each staff member.
I'm using the following code (Item holds the # of Staff members with their
ID#s in StaffIDArray()
Set RS = db.OpenRecordset("Cplan Outcome", dbOpenDynaset)
For Numb = 0 To Item
With RS
.AddNew
!StaffID = StaffIDArray(Numb)
!Category = NewCategory
!Outcome = ""
!Updated = Today 'CDate(Today)
!UpdatedBy = UpdatedBy
.Update
End With
Next Numb
RS.Close
I get error 3201, 'You cannot add or change a record because a related record
is required in table "CPlan Type"
How can I make this work??
Laurie