Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO/DAO confusion 1

Status
Not open for further replies.

oraclejunior

Technical User
Jul 8, 2003
111
GB
Hi there,

I am trying to use an update code to update a record.

I have the following code but does not work.

'saves change to the register detail
Private Sub Command26_Click()

Dim db As DAO.database
Dim rst As DAO.Recordset

Set db = CurrentDb
Set rst = db.openrecordset("select * from register where registerid =" & RegName)
rst.EditMode
rst!RegName = RegName
rst!RegOwner = RegOwner
rst!RegSectionDept = RegSectionDept
rst!RegisterLevel = RegisterLevel
rst.Update
rst.Close
Set rst = Nothing

End Sub

The error i get is "user-defined type not defined" compile error.

Am I doing something very wrong. I am using unbound forms.

TA
 
menu Tools -> References ...
Tick the Microsoft DAO 3.# library.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top