I am brand new to vba for access and I tried running some examples from a book I read, but the objects I am referencing are not being recognized (like dim db as database). Do I have to reference or import anything first? The code that doesn't work is as follows:

VB Code:
  1. Option Compare Database
  2.  
  3. Sub exaCreateQuery()
  4.  
  5. Dim db As database
  6. Dim rs As Recordset
  7. Set db = CurrentDb
  8.  
  9.  
  10. End Sub

produces the error: user defined type not defined