G
Guest
Can anyone help with updating two controls on a form where each gets it's
default value from a separate form? I can get each to work separately, but
can't get them to work together. I set this up in a macro, but here is the
converted module:
Function SetTaskWorker1()
On Error GoTo SetTaskWorker1_Err
DoCmd.OpenForm "Auto_Add Activity to a Task", acNormal, "", "", , acHidden
Forms![Auto_Add Activity to a Task]!Task = Forms![Auto_Update
Task]![Task Number]
DoCmd.OpenForm "TaskWorker", acFormDS, "", "", , acHidden
Forms![Auto_Add Activity to a Task]![Task Worker] =
Forms!TaskWorker![Task Worker]
SetTaskWorker1_Exit:
Exit Function
SetTaskWorker1_Err:
MsgBox Error$
Resume SetTaskWorker1_Exit
End Function
My main form is named [Auto_Update Task]
Subform is named [Auto_Add Activity to a Task]
The two controls are on the subform.
I'm currently calling the macro from the On Open event of the main form. It
is updating the Task Number, but not the Task Worker.
Any advice appreciated!
default value from a separate form? I can get each to work separately, but
can't get them to work together. I set this up in a macro, but here is the
converted module:
Function SetTaskWorker1()
On Error GoTo SetTaskWorker1_Err
DoCmd.OpenForm "Auto_Add Activity to a Task", acNormal, "", "", , acHidden
Forms![Auto_Add Activity to a Task]!Task = Forms![Auto_Update
Task]![Task Number]
DoCmd.OpenForm "TaskWorker", acFormDS, "", "", , acHidden
Forms![Auto_Add Activity to a Task]![Task Worker] =
Forms!TaskWorker![Task Worker]
SetTaskWorker1_Exit:
Exit Function
SetTaskWorker1_Err:
MsgBox Error$
Resume SetTaskWorker1_Exit
End Function
My main form is named [Auto_Update Task]
Subform is named [Auto_Add Activity to a Task]
The two controls are on the subform.
I'm currently calling the macro from the On Open event of the main form. It
is updating the Task Number, but not the Task Worker.
Any advice appreciated!