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
DS - 27 May 2008 20:08 GMT
Problem Solved, I formated each returned value in the function as opposed to
setting the fuction to a fromat type.
Thanks
DS
Douglas J. Steele - 27 May 2008 20:29 GMT
Yup, that's about the only way you can do it.
Be aware, though, that that converts your values to strings, not numbers.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Problem Solved, I formated each returned value in the function as opposed
> to setting the fuction to a fromat type.
> Thanks
> DS
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
DS - 28 May 2008 04:20 GMT
OH OH, but maybe not it's just for display purposes in a listbox. I would
assume that this is ok?
Thanks
DS
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.