Problem with ParaQuerySelect2K.mdb sample database

  • Thread starter Thread starter Mike Webb
  • Start date Start date
M

Mike Webb

The author of the database is Roger Carlson.

My skill level: Beginner

I am trying to duplicate his frmCreateSelectGl actions in my database and
ran into a problem with the VB code. I differed from his sample in that I
created a Make Table query to create one table from 2 tables and a join
table. I created a form that is supposed to use the input from combo boxes
to create a query. The problem code is pasted below:

Private Sub cmdRunQuery_Click()
On Error GoTo Err_cmdRunQuery_Click

Dim db As Database
Dim qdf As Access
Dim strSQL As String

When I click the SAVE button in Visual Basic after inserting the code, I get
an error "Compile error. User-defined type not defined." When I click OK
on that dialog box, I see "Private Sub cmdRunQuery_Click()" highlighted in
yellow and "Dim db As Database" highlighted in blue - actually just "db As
Database".

I looked it up in HELP and got lost on where to proceed with the info
presented as possible causes. I looked back over the sample database and
did not find a macro or module, so I'm at a loss on what I did different.

I am running Access 2K2.

TIA,
Mike
 
Open a module and select Tools|References and then make sure that a
"Microsoft DAO ..." library is checked. You may also want to change the code
to something like
Dim db As DAO.Database
Dim qdf As DAO.Access 'are you sure this isn't As QueryDef?
Dim strSQL As String
 
You were correct, as was confirmed off-line by the database author. I did
as suggested and it worked. Thanks for the quick response.

Mike
 
Roger provides a great service with his many SSDBs (Small Sample Databases).
Keep going back for more good ideas.
 
Back
Top