J
Joanne
I'm so confused, I just feel like giving this whole thing up. But I'll try
to explain. I have a subform in a form which is for totaling vacation time.
In the subform each line represents one request for vacation time. The
fields are as follows:
Begin Date End Date Type of Day Total Days
The "type of day" can be "personal", "vacation", "jury duty" or "carryover".
The total days field has the following in it:
=IIf([Type Of Day]="Personal" Or [Type Of Day]="Jury Duty" Or [Type of
Day]="Carryover","N/A",DateDiff("d",[OLP Begin Date],[OLP End Date]))
This works fine. But then I've put a calculated field into my query called
"Total Vacation" with the same code. Then in my footer on the subform I put
=Sum([TotalVacation]) and I get #error when I view the form. I'm so confused
because 1. I don't understand why I'm getting the error and 2. I don't
understand why I have to bind the field in the footer to a field in the query
when it could just calculate right from the form, couldn't it? Couldn't it
just add up all of the "total days" entries right in the form? This seems
like cheating since it's not really doing a direct calculation. What if I
changed the code in the form and forgot to change it in the query? Thanks
for getting me unconfused about this.
to explain. I have a subform in a form which is for totaling vacation time.
In the subform each line represents one request for vacation time. The
fields are as follows:
Begin Date End Date Type of Day Total Days
The "type of day" can be "personal", "vacation", "jury duty" or "carryover".
The total days field has the following in it:
=IIf([Type Of Day]="Personal" Or [Type Of Day]="Jury Duty" Or [Type of
Day]="Carryover","N/A",DateDiff("d",[OLP Begin Date],[OLP End Date]))
This works fine. But then I've put a calculated field into my query called
"Total Vacation" with the same code. Then in my footer on the subform I put
=Sum([TotalVacation]) and I get #error when I view the form. I'm so confused
because 1. I don't understand why I'm getting the error and 2. I don't
understand why I have to bind the field in the footer to a field in the query
when it could just calculate right from the form, couldn't it? Couldn't it
just add up all of the "total days" entries right in the form? This seems
like cheating since it's not really doing a direct calculation. What if I
changed the code in the form and forgot to change it in the query? Thanks
for getting me unconfused about this.