Fritz Paul
asked on
Help me see my error with VBA recordset
What am I doing wrong.
I am simply trying to run through a Table1 and list all the FirstNames.
Please look at the attached picture to see what everything looks like.
Also here is the code:
The error is "method or data member not found."I will also attach the database.
DatabaseTest.accdb
I am simply trying to run through a Table1 and list all the FirstNames.
Please look at the attached picture to see what everything looks like.
Also here is the code:
Option Compare Database
Private Sub Command0_Click()
Dim db As Database
Dim FName As String
Set db = CurrentDb
Dim rst0 As DAO.Recordset
Set rst0 = db.OpenRecordset("Table1")
rst0.MoveFirst
Do Until rst0.EOF
FName = rst0.[FirstName]
Debug.Print FName
rst0.MoveNext
Loop
Debug.Print "Completed"
End Sub
The error is "method or data member not found."I will also attach the database.
DatabaseTest.accdb
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Rey.
Gustav your suggestion also works.
Gustav your suggestion also works.
Of course. Don't know it was duplicated two hours later.
/gustav
/gustav
Could it be that it's the caption rather than the field name?