jacktripper
Programmer
I know I have successfully done this before, and for the life of me I have no clue what I'm doing wrong. Too much time in the office, maybe.
Have report which uses a separate query for pulling data. The query uses an ID parameter which I am trying to pass from my form via VBA code. Yet - the report ALWAYS asks me for the ID when, obviously, I don't want it to...
VBA code in Form:
Dim ThisID
ThisID = Me.ID
DoCmd.OpenReport "Retail Invoice", acViewPreview, , "ID=" & ThisID
Retail Invoice report has qryRetailInvoice as its data. The ID variable above is being populated correclty.
qryRetailInvoice looks like:
PARAMETERS ID Long;
SELECT [Print Shop Allocation].*, [Print Shop Retail Details].*, [Print Shop Allocation].ID
FROM [Print Shop Allocation] INNER JOIN [Print Shop Retail Details] ON [Print Shop Allocation].ID = [Print Shop Retail Details].AllocationID
WHERE ((([Print Shop Allocation].ID)=[ID]));
And yet, every time I run it... I am always prompted for the ID value. Ideas?