Dear Peter,
Thanks for your suggestion. But it may take time for me to really how it
works and how I can implement this into my database.
I managed to get the form to view the way I want it but the form keeps
popping up for a parameter value.
CaseID | VehicleNo | Col1 | Col2 | Subtotal
-------------------------------------------------------------
Case01 | Car1 | Det1b | Det2b | Det1b + Det2b
Case02 | Car2 | Det3b | 0.00 | Det3b + 0.00
Case03 | Car1 | Det4b | 0.00 | Det4b + 0.00
using the expression in a query:
sum(iif(CaseDet1 = 'ABC', [CaseDet2], 0.00)) as Col1
sum(iif(CaseDet1 = 'XYZ', [CaseDet2], 0.00)) as Col2
([Col1] + [Col2]) as Subtotal
But it keeps popping a pop-up "Enter Parameter Value" for Col1 and Col2. How
do I prevent the form from popping-up the "Enter Parameter Value" for Col1
and Col2?
Thanks again to all who have tried helping me out.
Best regards,
Kelvin
> Kelvin
>
[quoted text clipped - 50 lines]
> >> if it does. Unless I'm missing something, your remaining code is
> >> unnecessary.
Peter Hibbs - 23 Mar 2007 10:40 GMT
Hi Kelvin
I can only suggest you post the SQL for the query along with the field
types, etc and someone may be able to help. What happens if you remove
the ([Col1] + [Col2]) as Subtotal part of the query.
Peter Hibbs.
>Dear Peter,
>
[quoted text clipped - 78 lines]
>> >> if it does. Unless I'm missing something, your remaining code is
>> >> unnecessary.
AccessVandal - 23 Mar 2007 10:52 GMT
Hi,
Try "[Col1] + [Col2] as Subtotal". without the curve brackets.
>Kelvin Leong wrote:
>CaseID | VehicleNo | Col1 | Col2 | Subtotal
>-------------------------------------------------------------
[quoted text clipped - 10 lines]
>do I prevent the form from popping-up the "Enter Parameter Value" for Col1
>and Col2?
Douglas J. Steele - 23 Mar 2007 11:59 GMT
You cannot refer to computed columns in queries: you have to repeat the
calculation.
Try:
sum(iif(CaseDet1 = 'ABC', [CaseDet2], 0.00) + iif(CaseDet1 = 'XYZ',
[CaseDet2], 0.00)) as Subtotal

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Dear Peter,
>
[quoted text clipped - 84 lines]
>> >> if it does. Unless I'm missing something, your remaining code is
>> >> unnecessary.
Kelvin Leong - 23 Mar 2007 13:06 GMT
Hi Douglas,
Thanks for the advise. It helped and the form no longer have the pop-ups.
Thanks Peter and AccessVandal for your time to look at my problem as well.
Best regards,
Kelvin
> You cannot refer to computed columns in queries: you have to repeat the
> calculation.
[quoted text clipped - 92 lines]
> >> >> if it does. Unless I'm missing something, your remaining code is
> >> >> unnecessary.