Recordset.Edit Problems

mattcdse

Registered User.
Local time
Today, 08:18
Joined
Nov 23, 2005
Messages
42
Hi all,

I get an Invalid or Unqualified Reference error with this code, highlighting !Comments. Comments is a Memo field in the tblSOftware table. The code is being run from a button on a form. Anyone got any ideas what's up??

Cheers,

Matt


Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strComments As String

'Setup Objects
Set db = CurrentDb
Set rs = db.OpenRecordset("tblSoftware", dbOpenTable)

'Set Index and Seek for record
rs.Index = "Software Code"
rs.Seek "=", Me.SoftwareCodeNew

'Get Text String
strComments = Me.CommentsNew.Text

'Edit Record in Comments field
rs.Edit
!Comments = strComments

'Update and close recordset
rs.Update
rs.Close
db.Close 'Do i need this line of code since I'm using the current DB?
Set rs = Nothing
Set db = Nothing
 
rs!Comments = strComments
 

Users who are viewing this thread

Back
Top Bottom