R
Robin
I hope someone can help me. By inserting a MsgBox at various points in the
code, I have determined the "Invalid use of Null" occurs at the DSum line. I
originally did not have the Nz() function and got the same message. The
relevant portion of my code is as follows:
Case "3 Day Interval"
Dim dToday As Date
Dim dEDate1 As Date
Dim dEDate2 As Date
Dim dEDate3 As Date
Dim vCA1SHrs As Single
Dim vCA1Hrs As Single
Dim vCA2SHrs As Single
Dim vCA2Hrs As Single
Dim vCA3SHrs As Single
Dim vCA3Hrs As Single
Me.txtDate1SubSs = DateAdd("d", 2, Date)
Me.txtDate2SubSs = DateAdd("d", 3, Me.txtDate1SubSs)
Me.txtDate3SubSs = Me.txtDate2SubSs
Me.lstCA1SubSs.Requery
Me.lstCA2SubSs.Requery
Me.lstCA3SubSs.Requery
dToday = Date
dEDate1 = Me.txtDate1SubSs
vCA1SHrs = DSum("Nz([StaffAvail]![Hours],0)", "StaffAvail", _
"[Date] Between " & dToday & " And " & dEDate1 & "")
Me.txtCA1SHrs = vCA1SHrs
Case Else
End Select
The extra variables are because when I get this working, I have to use it
for two more date ranges.
Thank you for any help,
Robin
code, I have determined the "Invalid use of Null" occurs at the DSum line. I
originally did not have the Nz() function and got the same message. The
relevant portion of my code is as follows:
Case "3 Day Interval"
Dim dToday As Date
Dim dEDate1 As Date
Dim dEDate2 As Date
Dim dEDate3 As Date
Dim vCA1SHrs As Single
Dim vCA1Hrs As Single
Dim vCA2SHrs As Single
Dim vCA2Hrs As Single
Dim vCA3SHrs As Single
Dim vCA3Hrs As Single
Me.txtDate1SubSs = DateAdd("d", 2, Date)
Me.txtDate2SubSs = DateAdd("d", 3, Me.txtDate1SubSs)
Me.txtDate3SubSs = Me.txtDate2SubSs
Me.lstCA1SubSs.Requery
Me.lstCA2SubSs.Requery
Me.lstCA3SubSs.Requery
dToday = Date
dEDate1 = Me.txtDate1SubSs
vCA1SHrs = DSum("Nz([StaffAvail]![Hours],0)", "StaffAvail", _
"[Date] Between " & dToday & " And " & dEDate1 & "")
Me.txtCA1SHrs = vCA1SHrs
Case Else
End Select
The extra variables are because when I get this working, I have to use it
for two more date ranges.
Thank you for any help,
Robin