D
drorm
Guest
I am a new VBA Programmer in Access 2000. I am trying to open a recordset and I keep getting error messages. can someone help?. Here is the Syntex:
Private Sub Command9_Click()
Dim Form As String
Dim strSQL As String
Dim intCount As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Form=Forms![WTNS1]![BTN]
Set db = CurrentDb()
Set rs = db.OpenRecordset("qryfill", OpenDynaset)
Do Until rs.EOF
strType = rs.Fields(0)
Debug.Print strType
rs.MoveNext
Loop
rs.Close
End Sub
I get error 3001 invalid Argument
Also, trying to replace the name of the query with strSQL= " SELECT WTN from WTNS WHERE BTN= " & FORM
It does not work either.
What is going on
Private Sub Command9_Click()
Dim Form As String
Dim strSQL As String
Dim intCount As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Form=Forms![WTNS1]![BTN]
Set db = CurrentDb()
Set rs = db.OpenRecordset("qryfill", OpenDynaset)
Do Until rs.EOF
strType = rs.Fields(0)
Debug.Print strType
rs.MoveNext
Loop
rs.Close
End Sub
I get error 3001 invalid Argument
Also, trying to replace the name of the query with strSQL= " SELECT WTN from WTNS WHERE BTN= " & FORM
It does not work either.
What is going on