Edit a Query by Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to edit a query using the "On Click" event?
I have a form that displays a list of avaiable reports. One report has a
sub-report in it that has a query as the data source. When selected the
reports criteria needs to set based on the individual's record, so I need to
pass the Record_ID into the query before the "OpenReport" command.

Thanks in advance!

Dwight
 
You can filter the query with a function.
Select * From MyTable Where MyField = GetParam()
The function will return a global variable

Function GetParam()
GetParam=GlobalVar
end function
Declare the variable
Global GlobalVar as ....

On the on click event assign a value to the global variable GlobalVar

Another way is to change the SQL in the query, if you interested.
 
Back
Top