recordset help

action

Registered User.
Local time
Tomorrow, 09:00
Joined
May 29, 2003
Messages
89
I have asked this before but can't get the right answer. I am unsure if I have the bracketing right below for the line

rs.[Fivecents] = Me![Txtmultiply5cents]

[Fivecents] being the table field and [Txtmultiply5cents] being the unbound text box on the form.

Code:


Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("TBLCashdeclaration", dbOpenDynaset)
rs.AddNew
rs.[Fivecents] = Me![Txtmultiply5cents]
rs!dtCreated = Now()
rs.Update
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing


Can Anybody correct my error?

Thanks
 
Try changing

rs.[Fivecents] = Me![Txtmultiply5cents]

To

rs![Fivecents] = Me![Txtmultiply5cents]

As for bracketing, u don't really need any. So:
rs!Fivecents = Me!Txtmultiply5cents
Would work fine. Bracketing is mainly used when field names have spaces...
 
Last edited:
great, thanks.
 

Users who are viewing this thread

Back
Top Bottom