QueryDef definition

mchoud

Registered User.
Local time
Today, 16:47
Joined
Jun 3, 2003
Messages
25
Dear All

I have code like the following, and when i try to run this code, there is an error message appeared " user define type not defined ?

what its mean ?

Private Sub Command5_Click()
Dim qdf As QueryDef
If vbYes = MsgBox("Are you sure want to delete the current record", vbYesNo) Then
Set qdf = CurrentDb.CreateQueryDef("", "DELETE * FROM bincard WHERE contro_id = '" + Me.bincard_sub.Form!contro_id + "'")
qdf.Execute
MsgBox "The record has been deleted"
Me.SupplierSub.Form.Requery
End If
End Sub

Thanks
mchoud
 
What version of Access are you running? On which version of Access was the file created? You often get that error message if you type DAO code into Access 2000+ and run it because the default data access language in Access 2000+ is ADO.
 
dcx693 said:
What version of Access are you running? On which version of Access was the file created? You often get that error message if you type DAO code into Access 2000+ and run it because the default data access language in Access 2000+ is ADO.

I am using Ms Access 2000, so what should i do for solving that problem,
Thanks
 
In the Visual Basic Editor, go to the Tools menu and choose References. Look down the list of checked items. Chances are you have one called Microsoft ActiveX Data Objects (if you created the file in Access 2000). You can uncheck it, unless you've going to be writing ADO code. Then look for something called Microsoft Data Access Objects 3.6 (or some other version). Check that, if it's unchecked. Then try compiling and running your code.
 
Hallo Dcx

Your sugested solution has fixing our problem.

Thanks a lot about all of your kind help and attention,
 

Users who are viewing this thread

Back
Top Bottom