I am trying to make a pass through querie on the fly. I want to select a series of variable by either drop down box or typing in the filter in an input box and then make the SQL string that defines the pass through.
The following works to some extent. But, when I open it, it will not "PassThrough" how do i make a pass through where I can select any input as a criteria?
In the properties box of a previously set up Working PasThrough, the "ODBC Connect Str" is formated as : ODBC;DSN=Title;SERVER=servername;pwd=password and the code is the same format that is generated here with this code - (just the pass through issue is sticking)
Using:
Private Sub Command1_Click()
Dim dbs As Database, qdf As QueryDef, strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT DISTINCT table1.no, table1.name " & _
"FROM d_base.table1 " & _
"WHERE table1.no= '" & "EnterNumberHere" & "' "
Set qdf = dbs.CreateQueryDef("TestQry", strSQL)
Any help is greatly appreciated.
The following works to some extent. But, when I open it, it will not "PassThrough" how do i make a pass through where I can select any input as a criteria?
In the properties box of a previously set up Working PasThrough, the "ODBC Connect Str" is formated as : ODBC;DSN=Title;SERVER=servername;pwd=password and the code is the same format that is generated here with this code - (just the pass through issue is sticking)
Using:
Private Sub Command1_Click()
Dim dbs As Database, qdf As QueryDef, strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT DISTINCT table1.no, table1.name " & _
"FROM d_base.table1 " & _
"WHERE table1.no= '" & "EnterNumberHere" & "' "
Set qdf = dbs.CreateQueryDef("TestQry", strSQL)
Any help is greatly appreciated.