D
DS
I'm opening the same report from different forms so I want to use the
OpenArgs.
This is the recordsource of my report. Its set on Open
Me.RecordSource = "SELECT tblCheckDetails.CDCheckID,
tblCheckDetails.CDQuantity, " & _
"IIf([CDSub]=1,tblItems.ItemName,IIf([CDSub]=2 Or [CDSub]=3,"" "" &
tblItems.ItemName,IIf([CDSub]=4,"" "" &
tblItems.ItemName,IIf([CDSub]=5,"" "" &
tblItems.ItemName,IIf([CDSub]=6,tblItems.ItemName))))) AS NAME, " & _
"IPRICE([CDQuantity],[CDPrice],[CDDiscountAmount],[CDDiscountPercent],[CDDiscountDP],[CDDiscountWhere],[CDTaxRate],[CDInclusive])
AS PRICE, " & _
"tblChecks.ChkDate, tblChecks.ChkTime, [ChkAlias] & "" / "" & [ChkGuests] AS
INFO,tblChecks.ChkServer " & _
"FROM (tblChecks INNER JOIN tblCheckDetails ON tblChecks.CheckID =
tblCheckDetails.CDCheckID) " & _
"INNER JOIN tblItems ON tblCheckDetails.CDItemID = tblItems.ItemID " & _
"WHERE (((tblCheckDetails.CDCheckID)=[OpenArgs]))" & _
"UNION " & _
"SELECT tblDiscountDetails.CDCheckID, tblDiscountDetails.CDQuantity, " & _
"tblDiscounts.DiscountName AS NAME,
DPRICE([CDDiscountDP],[CDDiscountAmount],[CDDiscountPercent]) AS PRICE, " &
_
"tblChecks.ChkDate, tblChecks.ChkTime, """" AS INFO,tblChecks.ChkServer " &
_
"FROM (tblChecks INNER JOIN tblDiscountDetails ON tblChecks.CheckID =
tblDiscountDetails.CDCheckID) " & _
"INNER JOIN tblDiscounts ON tblDiscountDetails.CDDiscountID =
tblDiscounts.DiscountID " & _
"WHERE (((tblDiscountDetails.CDCheckID)=[OpenArgs]));"
The Command Button has this behind it
DoCmd.OpenReport,"rptCheck",,,,,,Me.TextID
However I keep getting a prompted for the OpenArgs when the report opens.
Any Direction appreciated.
Thanks
DS
OpenArgs.
This is the recordsource of my report. Its set on Open
Me.RecordSource = "SELECT tblCheckDetails.CDCheckID,
tblCheckDetails.CDQuantity, " & _
"IIf([CDSub]=1,tblItems.ItemName,IIf([CDSub]=2 Or [CDSub]=3,"" "" &
tblItems.ItemName,IIf([CDSub]=4,"" "" &
tblItems.ItemName,IIf([CDSub]=5,"" "" &
tblItems.ItemName,IIf([CDSub]=6,tblItems.ItemName))))) AS NAME, " & _
"IPRICE([CDQuantity],[CDPrice],[CDDiscountAmount],[CDDiscountPercent],[CDDiscountDP],[CDDiscountWhere],[CDTaxRate],[CDInclusive])
AS PRICE, " & _
"tblChecks.ChkDate, tblChecks.ChkTime, [ChkAlias] & "" / "" & [ChkGuests] AS
INFO,tblChecks.ChkServer " & _
"FROM (tblChecks INNER JOIN tblCheckDetails ON tblChecks.CheckID =
tblCheckDetails.CDCheckID) " & _
"INNER JOIN tblItems ON tblCheckDetails.CDItemID = tblItems.ItemID " & _
"WHERE (((tblCheckDetails.CDCheckID)=[OpenArgs]))" & _
"UNION " & _
"SELECT tblDiscountDetails.CDCheckID, tblDiscountDetails.CDQuantity, " & _
"tblDiscounts.DiscountName AS NAME,
DPRICE([CDDiscountDP],[CDDiscountAmount],[CDDiscountPercent]) AS PRICE, " &
_
"tblChecks.ChkDate, tblChecks.ChkTime, """" AS INFO,tblChecks.ChkServer " &
_
"FROM (tblChecks INNER JOIN tblDiscountDetails ON tblChecks.CheckID =
tblDiscountDetails.CDCheckID) " & _
"INNER JOIN tblDiscounts ON tblDiscountDetails.CDDiscountID =
tblDiscounts.DiscountID " & _
"WHERE (((tblDiscountDetails.CDCheckID)=[OpenArgs]));"
The Command Button has this behind it
DoCmd.OpenReport,"rptCheck",,,,,,Me.TextID
However I keep getting a prompted for the OpenArgs when the report opens.
Any Direction appreciated.
Thanks
DS