I am moving an inventory database from dBaseIV into Access 2000. The dbase database uses a "record count" to increment the Tagnum field by 1. I don't want to use the Access Autonumber or the Access "record count" method. Access deletes records differently than dBase.
When I move to a new record, I want the Tagnum field to increment by 1.
My "Add New Record" is set up to "On Click" read the "DoCmd.GoToRecord ,, acNewRec" command. I am putting the code in the "On Enter" part of this control.
On July 11,2003 BotCow(Programmer) posted a similar question (answered by legos(Programmer)and I am trying to use the same code.
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Dim num As Variant
Set rst = db.OpenRecordset("select * from Inventor"
rst.MoveLast
num = rst!Tagnum
num = num + 1
rst.AddNew
rst!Tagnum = num
rst.Update
Where am I going wrong? This is my first post so if I am out of line anywhere, please advise.
Thanks!
BecBec
When I move to a new record, I want the Tagnum field to increment by 1.
My "Add New Record" is set up to "On Click" read the "DoCmd.GoToRecord ,, acNewRec" command. I am putting the code in the "On Enter" part of this control.
On July 11,2003 BotCow(Programmer) posted a similar question (answered by legos(Programmer)and I am trying to use the same code.
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Dim num As Variant
Set rst = db.OpenRecordset("select * from Inventor"
rst.MoveLast
num = rst!Tagnum
num = num + 1
rst.AddNew
rst!Tagnum = num
rst.Update
Where am I going wrong? This is my first post so if I am out of line anywhere, please advise.
Thanks!
BecBec