R
Ripper
I've written a function that figures number of days from a given date. It
works well, but I am trying to make if fly from within a subform and make it
plug the result into a field in the parent form and I'm not getting the
syntax right. Everything within the If statement works, but the last
statement generates a missing object error. The whole statement is
highlighted in the editor, so I'm not sure which part is the offending part.
Can someone help? Many thanks!
Rip
If Not IsNull(DLookup("BusDayLimit", "qryTimeLimits", _
"[HearingType] = '" & Forms!frmMain!frmHearings.Form.HearingType & "'"))
Then
lngNumDays = DLookup("BusDayLimit", "qryTimeLimits", _
"[HearingType] = '" & Forms!frmMain!frmHearings.Form.HearingType & "'")
Else: MsgBox "Data Error! Last day calculation failed. ", vbExclamation,
"Data Error"
End If
Forms!frmMain!frmHearings.Form!LastDate = _
CalcLastDay(Forms!frmMain!frmHearings.Form!ReviewDate, lngNumDays, _
db.Properties("bWeekends"), db.Properties("bHolidays"))
works well, but I am trying to make if fly from within a subform and make it
plug the result into a field in the parent form and I'm not getting the
syntax right. Everything within the If statement works, but the last
statement generates a missing object error. The whole statement is
highlighted in the editor, so I'm not sure which part is the offending part.
Can someone help? Many thanks!
Rip
If Not IsNull(DLookup("BusDayLimit", "qryTimeLimits", _
"[HearingType] = '" & Forms!frmMain!frmHearings.Form.HearingType & "'"))
Then
lngNumDays = DLookup("BusDayLimit", "qryTimeLimits", _
"[HearingType] = '" & Forms!frmMain!frmHearings.Form.HearingType & "'")
Else: MsgBox "Data Error! Last day calculation failed. ", vbExclamation,
"Data Error"
End If
Forms!frmMain!frmHearings.Form!LastDate = _
CalcLastDay(Forms!frmMain!frmHearings.Form!ReviewDate, lngNumDays, _
db.Properties("bWeekends"), db.Properties("bHolidays"))