D
Duck
I am trying to learn VBA for Access coding and I can't figure out why
the following bit of code fails to compile with the error message:
"Method Or Data Member Not Found" I am merely trying to find all the
customers in our customer table with the last name of Jones and add
their Name and address to a new table. I wrote this procedure in a
standard module, and I do have a reference to DAO 3.6 library.
Public Sub FindJones()
Dim dbPico As DAO.Database
Dim rstCustomer As DAO.Recordset
Dim rstJonses As DAO.Recordset
Set dbPico = CurrentDb
Set rstCustomer = dbPicpenRecordset("tblCustomer")
Set rstJonses = dbPicpenRecordset("tblJonses")
rstCustomer.MoveFirst
Do While rstCustomer.EOF = False
rstCustomer.Find "LName = 'Jones'"
If Not rstCustomer.NoMatch Then
rstJonses.AddNew
With rstJonses
![CustID] = rstCustomer![CustID]
![FName] = rstCustomer![FName]
![LName] = rstCustomer![LName]
![Address] = rstCustomer![Address]
.Update
End With
End If
Debug.Print rstCustomer![FName] & " " & rstCustomer![LName] &
" Added"
Loop
End Sub
the following bit of code fails to compile with the error message:
"Method Or Data Member Not Found" I am merely trying to find all the
customers in our customer table with the last name of Jones and add
their Name and address to a new table. I wrote this procedure in a
standard module, and I do have a reference to DAO 3.6 library.
Public Sub FindJones()
Dim dbPico As DAO.Database
Dim rstCustomer As DAO.Recordset
Dim rstJonses As DAO.Recordset
Set dbPico = CurrentDb
Set rstCustomer = dbPicpenRecordset("tblCustomer")
Set rstJonses = dbPicpenRecordset("tblJonses")
rstCustomer.MoveFirst
Do While rstCustomer.EOF = False
rstCustomer.Find "LName = 'Jones'"
If Not rstCustomer.NoMatch Then
rstJonses.AddNew
With rstJonses
![CustID] = rstCustomer![CustID]
![FName] = rstCustomer![FName]
![LName] = rstCustomer![LName]
![Address] = rstCustomer![Address]
.Update
End With
End If
Debug.Print rstCustomer![FName] & " " & rstCustomer![LName] &
" Added"
Loop
End Sub