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
.MoveFirst
Do Until .EOF
mNumber = mNumber + 1
.Edit
![BusNo] = mNumber
.Update
.MoveNext
Loop
End If
End With
rst.Close
Set dbs = Nothing
End Sub
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
.MoveFirst
Do Until .EOF
mNumber = mNumber + 1
.Edit
![BusNo] = mNumber
.Update
.MoveNext
Loop
End If
End With
rst.Close
Set dbs = Nothing
End Sub