Can somebody explain to me why I can never get DAO or ADO techniques to work. For example, I want to update a record using DAO, heres an example of what I did:
Dim dbs As Database
Dim rst As dao.Recordset
Dim sSelect As String
Set dbs = CurrentDb
Set rst = rs.openrecordset("select [Location2] from [dbo_Inv Master] WHERE [Inventory Part] ='" & PartStr & "'", dbOpendynaset)
With rst
.edit
![Location2] = "Changed"
.Update
End With
rst.Close
and here is the error I get:
"User defined type not defined" and It highlights:
Dim dbs as Database
I suppose I need to define it but where? I'm sure there is a simple reolution, just can't figure it out.
Can anybody help?
Thanks,
Dodge
Dim dbs As Database
Dim rst As dao.Recordset
Dim sSelect As String
Set dbs = CurrentDb
Set rst = rs.openrecordset("select [Location2] from [dbo_Inv Master] WHERE [Inventory Part] ='" & PartStr & "'", dbOpendynaset)
With rst
.edit
![Location2] = "Changed"
.Update
End With
rst.Close
and here is the error I get:
"User defined type not defined" and It highlights:
Dim dbs as Database
I suppose I need to define it but where? I'm sure there is a simple reolution, just can't figure it out.
Can anybody help?
Thanks,
Dodge