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:
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

Open in new window


The error is "method or data member not found."Simple-error.pngI will also attach the database.
DatabaseTest.accdb
Fritz PaulAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieVBA ExpertCommented:
Is FirstName definitely the field name?

Could it be that it's the caption rather than the field name?
0
Gustav BrockCIOCommented:
Change to this:

        FName = rst0!FirstName.Value

/gustav
0
Rey Obrero (Capricorn1)Commented:
when you are dealing with recordsets use ! (bang) not . (dot)

 FName = rst0![FirstName]

or

 FName = rst0("FirstName")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fritz PaulAuthor Commented:
Thanks Rey.
Gustav your suggestion also works.
0
Gustav BrockCIOCommented:
Of course. Don't know it was duplicated two hours later.

/gustav
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.