D
DocBrown
I can't find an existing solution to this problem.
I have a main form that contains a subform whose record source is the
following query:
SELECT VolunteerLog.VolunteerID, nz(Sum([timeout]-[timein]),0) AS TotalHours
FROM VolunteerLog
GROUP BY VolunteerLog.VolunteerID;
The main form contains data for an individual Volunteer. The Subform
displays the total hours a volunteer has worked. The subform is linked to the
main form with the field VolunteerID. The volunteerLog is a record of the
shifts all the volunteers have worked. The subform displays the TotalHours
calculated field which is formatted into hh:mm.
The problem is this: If the main form is displaying a Volunteer who has no
logged hours and then I close the main form, I get a dialog warning box that
says 'No Current Record. I have confirmed that the error is coming from the
subform. For the OnError event in the subform, I coded the following:
MsgBox Err.Number & ":" & Err.Source & ":" & Err.Description
The msgbox displays: 0::
That's IT.
I've tried to put a normal field from the volunteerLog table in place of the
TotalHours field, but same error occurs.
Anyone have any ideas?
Thanks,
John
I have a main form that contains a subform whose record source is the
following query:
SELECT VolunteerLog.VolunteerID, nz(Sum([timeout]-[timein]),0) AS TotalHours
FROM VolunteerLog
GROUP BY VolunteerLog.VolunteerID;
The main form contains data for an individual Volunteer. The Subform
displays the total hours a volunteer has worked. The subform is linked to the
main form with the field VolunteerID. The volunteerLog is a record of the
shifts all the volunteers have worked. The subform displays the TotalHours
calculated field which is formatted into hh:mm.
The problem is this: If the main form is displaying a Volunteer who has no
logged hours and then I close the main form, I get a dialog warning box that
says 'No Current Record. I have confirmed that the error is coming from the
subform. For the OnError event in the subform, I coded the following:
MsgBox Err.Number & ":" & Err.Source & ":" & Err.Description
The msgbox displays: 0::
That's IT.
I've tried to put a normal field from the volunteerLog table in place of the
TotalHours field, but same error occurs.
Anyone have any ideas?
Thanks,
John