Hi all,
I'm using the following code to UPDATE a record in my DB.
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim STRsQL As String
Set db = CurrentDb
Set qdf = db.QueryDefs("query1")
STRsQL = "Update tblproducts set primary_material_no = '" & Combo59.Value & "' , secondary_material_no = '" & Cbo_subcategory.Value & "', Updated = 1 where [Product No] = '" & [Product No].Value & "'"
qdf.SQL = STRsQL
DoCmd.OpenQuery "query1"
Set qdf = Nothing
Set db = Nothing
But I am getting the error on the dim db as DAO.DATABASE line - User defined type not defined Error.
I have this code working in another program - can anyone tell me if i have forggoten a definition or something or do I need to change something in the DB properties??
Please help!
Maggie (Novice access user)
I'm using the following code to UPDATE a record in my DB.
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim STRsQL As String
Set db = CurrentDb
Set qdf = db.QueryDefs("query1")
STRsQL = "Update tblproducts set primary_material_no = '" & Combo59.Value & "' , secondary_material_no = '" & Cbo_subcategory.Value & "', Updated = 1 where [Product No] = '" & [Product No].Value & "'"
qdf.SQL = STRsQL
DoCmd.OpenQuery "query1"
Set qdf = Nothing
Set db = Nothing
But I am getting the error on the dim db as DAO.DATABASE line - User defined type not defined Error.
I have this code working in another program - can anyone tell me if i have forggoten a definition or something or do I need to change something in the DB properties??
Please help!
Maggie (Novice access user)