Invalid use of property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dim db As DAO.Database
Dim records As DAO.Recordset
Dim strSQL As String
db = CurrentDb
strSQL = "SELECT baanid FROM tennisbaan"
records = db.OpenRecordset(strSQL, dbOpenSnapshot)
Do Until records.EOF
Text0 = records![baanid]
records.MoveNext
Loop

It gives me an error on the 'db = CurrentDb' line saying 'invalid use of
property'.
I dont know what hey mean with it as im only using examples (mostly from
this site).

Maybe someone knows what i'm doing wrong.
 
Martijn you need to use the Set statement when assigning this object.

Set db = CurrentDb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top