469,601 Members | 2,383 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,601 developers. It's quick & easy.

Object variable not set or block width not set error

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
DRNo = rsWILAru![DR No] + 1

DoCmd.GoToRecord , , acNewRec
[DRNo] = DRNo

If anyone can hlep me sort this problem, I will be eternally grateful!


Oct 24 '06 #1
1 1798
8,435 Expert 8TB
Hi, can anyone help me before I slit my wrists?!?!

I don't know that I can be much help, but something did catch my eye. In this code...
Expand|Select|Wrap|Line Numbers
  1.        DRNo = rsWILAru![DR No] + 1
  3.         DoCmd.GoToRecord , , acNewRec
  4.         [DRNo] = DRNo
Shouldn't the two highlighted field names be the same?
Oct 24 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Neo Geshel | last post: by
1 post views Thread by finizaini | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.