G
Guest
I have a subform in a form that is called when the user dbl clicks a record
in another form which is a query based on data entered in an unbound form.
When I step through this code, I don't get any error messages, but when I am
returned to the form I don't have an added record with the data from the
unbound form.
Any suggestions? Thanks for your help.
Private Sub Form_Open(Cancel As Integer)
Dim strOpenCondition As String
' COMMENTS
'[frm scheduling-employees] is the main form of this subform
'main form record has correctly selected the proper record to edit based
on record selected on form [frm Scheduling - Employee Available] User
selected which employee to schedule
'populate field in schedule table based on fields on form [Frm
Scheduling - check Availability]
'END COMMENTS
If Not IsNull(Forms![frm Scheduling-Employees].OpenArgs) Then
strOpenCondition = Forms![frm Scheduling-Employees].OpenArgs
Select Case strOpenCondition
Case "addSCH"
RunCommand acCmdRecordsGoToNew
Me![sch start time].Value = Forms![Frm Scheduling - check
Availability].txtStart.Value
Me![SCH End Time].Value = Forms![Frm Scheduling - check
Availability].txtEnd.Value
Me![Monday].Value = Forms![Frm Scheduling - check
Availability].chkMonday.Value
Me![Tuesday].Value = Forms![Frm Scheduling - check
Availability].chkTuesday.Value
Me![Wednesday].Value = Forms![Frm Scheduling - check
Availability].chkWednesday.Value
Me![Thursday].Value = Forms![Frm Scheduling - check
Availability].chkThursday.Value
Me![Friday].Value = Forms![Frm Scheduling - check
Availability].chkFriday.Value
Me![Saturday].Value = Forms![Frm Scheduling - check
Availability].chkSaturday.Value
Me![Sunday].Value = Forms![Frm Scheduling - check
Availability].chkSunday.Value
Me![SCH-FK Client ID].SetFocus
End Select
End If
End Sub
in another form which is a query based on data entered in an unbound form.
When I step through this code, I don't get any error messages, but when I am
returned to the form I don't have an added record with the data from the
unbound form.
Any suggestions? Thanks for your help.
Private Sub Form_Open(Cancel As Integer)
Dim strOpenCondition As String
' COMMENTS
'[frm scheduling-employees] is the main form of this subform
'main form record has correctly selected the proper record to edit based
on record selected on form [frm Scheduling - Employee Available] User
selected which employee to schedule
'populate field in schedule table based on fields on form [Frm
Scheduling - check Availability]
'END COMMENTS
If Not IsNull(Forms![frm Scheduling-Employees].OpenArgs) Then
strOpenCondition = Forms![frm Scheduling-Employees].OpenArgs
Select Case strOpenCondition
Case "addSCH"
RunCommand acCmdRecordsGoToNew
Me![sch start time].Value = Forms![Frm Scheduling - check
Availability].txtStart.Value
Me![SCH End Time].Value = Forms![Frm Scheduling - check
Availability].txtEnd.Value
Me![Monday].Value = Forms![Frm Scheduling - check
Availability].chkMonday.Value
Me![Tuesday].Value = Forms![Frm Scheduling - check
Availability].chkTuesday.Value
Me![Wednesday].Value = Forms![Frm Scheduling - check
Availability].chkWednesday.Value
Me![Thursday].Value = Forms![Frm Scheduling - check
Availability].chkThursday.Value
Me![Friday].Value = Forms![Frm Scheduling - check
Availability].chkFriday.Value
Me![Saturday].Value = Forms![Frm Scheduling - check
Availability].chkSaturday.Value
Me![Sunday].Value = Forms![Frm Scheduling - check
Availability].chkSunday.Value
Me![SCH-FK Client ID].SetFocus
End Select
End If
End Sub