Hello,
What is the best way for me to get the value of a variable from a subroutine into another subroutine ?
The code I'm running is below, it calls the btnSearch_Click subroutine (a very long complex piece of code) in the same module. I just need to get the value of 'strFilter' from this in order for Print_Click() to work. How do I do that??
Appreciate any help!!
The code I'm running is below, it calls the btnSearch_Click subroutine (a very long complex piece of code) in the same module. I just need to get the value of 'strFilter' from this in order for Print_Click() to work. How do I do that??
Appreciate any help!!
Code:
Private Sub Print_Click()
Dim qryDef As QueryDef
Call btnSearch_Click
qrycriteria = "select * from tblmain where person_id in (" & strFilter & ")"
Set qryDef = CurrentDb.QueryDefs("qrytesting")
qryDef.SQL = qrycriteria
End Sub