VBA Alternative to a Query Parameter (1 Viewer)

ChrisMore

Member
Local time
Today, 19:58
Joined
Jan 28, 2020
Messages
86
Hi,

I have a query which runs the following syntax to show the inventory totals for all products based on a specific date (Onhand is the function to calculate the inventory totals):

OnHand([Product_Code],Format([Enter stocktake date to report on],"mm/dd/yyyy"))

In this instance the user enters the date of a stocktake to show every product's inventory total for that stocktake in the report. Current they enter the date through a parameter box but I would like to improve this so the user uses a form with a date formatted text box to enter the date to run with the query when the report opens.

The query is called Stocktake_Accounts_Report_Query
The report is called Stocktake_Account_Report_Report
The textbox is called Text16
The command button to run the code and open the report is called Command14

How should I approach the code to get this to work?

Thanks,
Chris
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:58
Joined
Oct 29, 2018
Messages
13,197
Hi Chris. Typically, you could just replace the parameter with a form reference like Forms!FormName.ControlName.
 

Users who are viewing this thread

Top Bottom