Hi, can anyone help me before I slit my wrists?!?!
I am trying to create a procedure in an Access 97 database, that basically creates a new record in a table called "Discrepancies", with an ID number 1 digit higher than the last record in the table. The name of the ID field is "DRNo". The code I am using is as follows, but I keep getting the error message, "Object variable not set or Block Width not set". This is my code:
Dim dbWILAdb As Database, rsWILArs As Recordset, rsWILArt As Recordset, rsWILAru As Recordset
Dim DRNo As Long
'find required discrepancy number
rsWILAru.MoveLast
DRNo = rsWILAru![DR No] + 1
DoCmd.GoToRecord , , acNewRec
[DRNo] = DRNo
If anyone can hlep me sort this problem, I will be eternally grateful!
Cheers
Mark