D
DS
I have a UNION Query that is giving me a Format problem.
Here is the Query.
With Forms!frmCheckPreview!ListOrders
..RowSource = "SELECT
tblCheckDetailsTMP.CDCheckID,tblCheckDetailsTMP.CDItemID, " & _
,IPRICE([CDQuantity],[CDPrice],[CDDiscountAmount],[CDDiscountPercent],[CDDiscountDP],[CDDiscountWhere],[CDTaxRate],[CDInclusive])
AS PRICE, " & _
"WHERE tblCheckDetailsTMP.CDCheckID = [Forms]![frmCheckAction]![TxtCheckID]
" & _
"AND tblCheckDetailsTMP.CDItemID >=41 " & _
"UNION " & _
"SELECT tblDiscountDetails.CDCheckID, tblblDiscountDetails.CDItemID, " & _
"DPRICE([CDDiscountDP],[CDDiscountAmount],[CDDiscountPercent]) AS PRICE, " &
_
"WHERE tblDiscountDetails.CDCheckID) = [Forms]![frmCheckAction]![TxtCheckID]
" & _
..ColumnCount = 3
..ColumnWidths = "0 in;0 in;.5 in"
..Requery
End With
The problem is the first query Price is always a currency format and the
second query can either be a currenct format or a percentage format. The
Functions are both set to be currency. If I make both functions a currency
type it's OK, but if the second query is a percent then I get an error
message type mismatch. How can I have the first query be a curency and the
second be either a currency or percent without receiving an error message?
Thanks
DS
Here is the Query.
With Forms!frmCheckPreview!ListOrders
..RowSource = "SELECT
tblCheckDetailsTMP.CDCheckID,tblCheckDetailsTMP.CDItemID, " & _
,IPRICE([CDQuantity],[CDPrice],[CDDiscountAmount],[CDDiscountPercent],[CDDiscountDP],[CDDiscountWhere],[CDTaxRate],[CDInclusive])
AS PRICE, " & _
"WHERE tblCheckDetailsTMP.CDCheckID = [Forms]![frmCheckAction]![TxtCheckID]
" & _
"AND tblCheckDetailsTMP.CDItemID >=41 " & _
"UNION " & _
"SELECT tblDiscountDetails.CDCheckID, tblblDiscountDetails.CDItemID, " & _
"DPRICE([CDDiscountDP],[CDDiscountAmount],[CDDiscountPercent]) AS PRICE, " &
_
"WHERE tblDiscountDetails.CDCheckID) = [Forms]![frmCheckAction]![TxtCheckID]
" & _
..ColumnCount = 3
..ColumnWidths = "0 in;0 in;.5 in"
..Requery
End With
The problem is the first query Price is always a currency format and the
second query can either be a currenct format or a percentage format. The
Functions are both set to be currency. If I make both functions a currency
type it's OK, but if the second query is a percent then I get an error
message type mismatch. How can I have the first query be a curency and the
second be either a currency or percent without receiving an error message?
Thanks
DS