New Record for Form and Subform

K

Kelly

Hello. I have a form that records user tasks. The user first has a pop up
form that allows them to choose their user name and click a button that opens
the main task form showing just their tasks. The main for contains general
task information and has a subform from a separate table that allows them to
enter multiple notes for each task. My master/child links work fine to allow
users to page through existing tasks, but they cannot enter new ones. I
suspect this is because I need to pass the user ID to the new record in both
tables but I can't seem to figure out how to do this. Please help!
 
D

Dirk Goldgar

Kelly said:
Hello. I have a form that records user tasks. The user first has a pop
up
form that allows them to choose their user name and click a button that
opens
the main task form showing just their tasks. The main for contains
general
task information and has a subform from a separate table that allows them
to
enter multiple notes for each task. My master/child links work fine to
allow
users to page through existing tasks, but they cannot enter new ones. I
suspect this is because I need to pass the user ID to the new record in
both
tables but I can't seem to figure out how to do this. Please help!


I don't see why the subform's recordsource table (TaskNotes, or whatever it
is) should have to contain the user ID, but the main form's recordsource
does. You can do this by having a (possibly hidden) control on the form,
bound to the UserID field, and setting that field's DefaultValue property to
the userID when you open the form. Or you can use the form's BeforeInsert
event to set the field's value.
 

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