R
Rebecca_SUNY
Using Access 2007
I am trying to use setdefault when opening a form from another form and
populate the value of a control (combo box). I have it working with the
following code.
Dim strFormName As String
Dim strSetID As String
strFormName = "frm_Attendance_Add_Launch"
strSetID = Me![ParticipantID]
DoCmd.OpenForm strFormName, acNormal, , , acFormAdd, acWindowNormal
Forms!frm_Attendance_Add_Launch!ParticipantID.DefaultValue = strSetID
Is issue is with this bit of code:
Forms!frm_Attendance_Add_Launch!ParticipantID.DefaultValue = strSetID
I would like to use a variable for the "Forms!frm_Attendance_Add_Launch!"
piece but I am unsure how to set the variable automatically and then use it
in the Defaultvalue code.
I am trying to use setdefault when opening a form from another form and
populate the value of a control (combo box). I have it working with the
following code.
Dim strFormName As String
Dim strSetID As String
strFormName = "frm_Attendance_Add_Launch"
strSetID = Me![ParticipantID]
DoCmd.OpenForm strFormName, acNormal, , , acFormAdd, acWindowNormal
Forms!frm_Attendance_Add_Launch!ParticipantID.DefaultValue = strSetID
Is issue is with this bit of code:
Forms!frm_Attendance_Add_Launch!ParticipantID.DefaultValue = strSetID
I would like to use a variable for the "Forms!frm_Attendance_Add_Launch!"
piece but I am unsure how to set the variable automatically and then use it
in the Defaultvalue code.