Full Version: Form not passing the arguments to the query
UtterAccess Forums > Microsoft® Access > Access Forms
elliot315
I have a report that summarizes the sales for a week... on a table I have all the cash reported by date and on other queries I have the details for the sales. The problem is that the form that calls the report and pass the arguments to the cash total query is not passing the arguments to the query (the FROM DATE and TO DATE). If I run the query alone.. it gives me the total cash for the date...the form is programmed to go invisible after opening the report... is that a problem for that query? Everything else on the report is all right.
ayme
hi
Y />our question is not clear,provide the code you are using
check you are passing like this
where OD1 is my Query and DD is DateField
D1 And D2 are Fields on Form and Cusid is a number Fields
change according to you.
Dim stDocName As String
stDocName = "OD1L"
DoCmd.OpenReport stDocName, acPreview, , "[OD1].[dd] Between #" _
& [Forms]![Reportsec]![D1] & "# And #" _
& [Forms]![Reportsec]![D2] & "# AND [OD1].[cusid]=" _
& [Forms]![Reportsec]![cusid]
HTH
ayme
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.