Need to create link record and update values.

D

Desert Bear

I have tblPeople, one to many tblVersion, one to many tblTasks.
The ideal time to create the tblVersion record linking person and tasks would be when the first task is entered for that person.
When I do that, I need to set the contents of two fields: Active = Yes, Version = 1, in visual basic code, as well as setting the person foreign key to the correct person ID in frmPerson.
How can I set a value in a table or query in Visual Basic?
(currently I use frmAddPerson which creates the person and opens frmAddVersion, which does NOT create a version record, and gives no error message. DoCmd.RunCommand acCmdSaveRecord didn't fix this problem. This is an attempted work-around to the problem, as I don't know how to create it at the ideal time, when the first task is created in frmPlan.)
The correct person name/id is in a combo box on frmPlan.
I would need to create the version record and set its foreign key to the combo box's primary key.
And set the new version record's Active field to Yes and its version field to 1, in visual basic as the user doesn't see these.
I get "field cannot be updated" as an error message.
 

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