E
eschloss
Access 2003
I do not understand why I receive an error for the indicated line below.
Please let me know my syntax error.
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim sql As String
Dim name() As String
Dim i As Integer
i = 0
sql = "SELECT L_tblArea_Tech.L_Tech " & _
"FROM L_tblArea_Tech " & _
"WHERE L_tblArea_Tech.L_Area = 'Q/A' And L_tblArea_Tech.L_Tech_Current
= Yes " & _
"ORDER BY L_tblArea_Tech.L_Tech;"
Set db = CurrentDb()
Set rst = db.OpenRecordset(sql)
rst.MoveFirst
Do While Not rst.EOF
i = i + 1
ReDim name(1 To i) As String
name(i) = rst!L_Tech <-----------Error
here----------------
rst.MoveNext
Loop
ReDim name(1) As String
rst.Close
Set rst = Nothing
MsgBox name7
End Sub
I do not understand why I receive an error for the indicated line below.
Please let me know my syntax error.
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim sql As String
Dim name() As String
Dim i As Integer
i = 0
sql = "SELECT L_tblArea_Tech.L_Tech " & _
"FROM L_tblArea_Tech " & _
"WHERE L_tblArea_Tech.L_Area = 'Q/A' And L_tblArea_Tech.L_Tech_Current
= Yes " & _
"ORDER BY L_tblArea_Tech.L_Tech;"
Set db = CurrentDb()
Set rst = db.OpenRecordset(sql)
rst.MoveFirst
Do While Not rst.EOF
i = i + 1
ReDim name(1 To i) As String
name(i) = rst!L_Tech <-----------Error
here----------------
rst.MoveNext
Loop
ReDim name(1) As String
rst.Close
Set rst = Nothing
MsgBox name7
End Sub