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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is wrong with this snippet?

Status
Not open for further replies.

hughed00

Technical User
Jan 15, 2001
43
0
0
US
Private Sub Text57_Click()
Dim rst As DAO.Recordset

Set rst = CurrentDb.OpenRecordset("AssignedNumber", dbOpenDynaset)

Text57.Value = rst!AssignedNumber
rst!AssignedNumber = rst!AssignedNumber - 1

Set rst = Nothing

End Sub

*/ This bit is supposed to fill a field on a form with the value of a table which is a piece of a composit number. It then decrements the field for the next time we use the form to create a new composit number.

The debugger doesn't like the decrementing line/*
 
In this case both, although there is no reason why it has to be.

ean13.AssignedNumber.AssignedNumber

db.tbl.fld
 

Before assigning a new values to a record set, you need to execute the Edit method. Then you'll need to execute the Update method to actually store the value on the table.

rst.edit
rst!AssignedNumber = rst!AssignedNumber - 1
rst.update Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Will give it a go after the meeting I should be paying attention to is over....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top