Message from Access 2007 on sub function

Sep 17, 2012
Reaction score
I have the following sub function and it works on access 2003 but on access 2007 it gives a message " Method or data number not found " any help thanks I,m New in this forum

Private Sub NewNums()
Dim dbs As Database
Dim rst As Recordset
Dim mNumber As Long

Set dbs = Application.CurrentDb
Set rst = dbs.OpenRecordset("SELECT BusNo FROM TblBusNo;", dbOpenDynaset)

With rst
If rst.RecordCount <> 0 Then
mNumber = 0
Do Until .EOF
mNumber = mNumber + 1
![BusNo] = mNumber
End If
End With

Set dbs = Nothing

End Sub

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question