hudson40
Jun 13th, 2000, 04:54 PM
when converting SQL in as command text in the record source in VB, is it possible to pass a variable ste up at design time?
Chris
Jun 13th, 2000, 06:30 PM
It is you want to create a dynamic SQL statement at runtime?
If yes, the it should be able to archieve it. like below:
Dim MyCriteria As String
Dim SQL As String
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
SQl = "SELECT * FROM TblName WHERE Field1='" & MyCriteria & "' ORDER BY Field1 ASC;"
Set Rs = Db.OpenRecordset(SQL,dnOpenSnapshot)