woodchuckwood
Registered User.
- Local time
- Today, 18:13
- Joined
- Jan 15, 2004
- Messages
- 10
Why wont this work?
----------------------------------------------
Private Sub Command5_Click()
Dim MyDb As Database
Dim qdf As QueryDef
Dim strSQL As String
Dim Rst As Recordset
Set MyDb = CurrentDb()
strSQL = "SELECT ReportGenerator.RptDesignName FROM ReportGenerator WHERE (((ReportGenerator.Region)=[Forms]![SelectRegion]![RegionList]));"
Set Rst = qdf.OpenRecordset
Do While Not Rst.EOF
Debug.Print qdf!RptDesignName
Rst.MoveNext
Loop
End Sub
------------------------------------------
I get the error at the "Set Rst = qdf.OpenRecordset" portion of the script.
I basically want to excecute the SQL statement because it will help generate the specific reports by the selected region. (I did not include the report generation code).
----------------------------------------------
Private Sub Command5_Click()
Dim MyDb As Database
Dim qdf As QueryDef
Dim strSQL As String
Dim Rst As Recordset
Set MyDb = CurrentDb()
strSQL = "SELECT ReportGenerator.RptDesignName FROM ReportGenerator WHERE (((ReportGenerator.Region)=[Forms]![SelectRegion]![RegionList]));"
Set Rst = qdf.OpenRecordset
Do While Not Rst.EOF
Debug.Print qdf!RptDesignName
Rst.MoveNext
Loop
End Sub
------------------------------------------
I get the error at the "Set Rst = qdf.OpenRecordset" portion of the script.
I basically want to excecute the SQL statement because it will help generate the specific reports by the selected region. (I did not include the report generation code).