Hi
This is my first time trying to use code to access a table in my database.
I followed examples I can find online, but I am getting a compile error for the most basic of functions;
Here is my code:
Code:
Private Sub Cmd_Button1_Click()
Dim dbs1 As DAO.Database
Dim rst1 As DAO.Recordset
Dim sql1 As String
Set dbs1 = CurrentDb
sql1 = "SELECT * FROM Tbl_Demo1"
rst1 = dbs1.OpenRecordset(sql1)
End Sub
When I click the button for this code to run, I get "Compile error: Invalid use of property" for this line (rst1 is highlighted):
Code:
rst1 = dbs1.OpenRecordset(sql1)
So I think there is some fundamental knowledge / bit of info that I am missing
Any help appreciated, thanks
Garrett