Hi all,
I am just trying to get the basic hang of using sql within the VBA attached to my database ... without a great lot of luck.
This is the basic format I have so far:
Public Sub DoSQL()
Dim SQL As String
SQL = "SELECT Breed.Sub_Species " & _
"FROM Breed"
Dim db As dao.database
Dim rs As dao.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(SQL)
End Sub
But every time I call it up I get this:
Compile Error:
User defined type not defined
[db As dao.database] <<-- with this highlighted within the code.
Thanks in advance ...
I am just trying to get the basic hang of using sql within the VBA attached to my database ... without a great lot of luck.
This is the basic format I have so far:
Public Sub DoSQL()
Dim SQL As String
SQL = "SELECT Breed.Sub_Species " & _
"FROM Breed"
Dim db As dao.database
Dim rs As dao.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(SQL)
End Sub
But every time I call it up I get this:
Compile Error:
User defined type not defined
[db As dao.database] <<-- with this highlighted within the code.
Thanks in advance ...