I have a sub that I'm calling from a macro:
Module Name: GeneralFunctions
Procedure Name: SequentialNumber
The program won't execute the sub; it simply stops at the first line of it and pulls up the "General Functions" screen as though I'm debugging. I can click the "Run" menu option and it will execute, but it won't do so automatically. Here's the sub:
Public Sub SequentialNumber()
Dim db As Database
Dim rs As Recordset
Dim lngLoop As Long
Set db = CurrentDb
Set rs = db.OpenRecordset("PeopleSoftOut2")
lngLoop = 1
Do
rs.Edit
rs!FileLine = lngLoop
rs.Update
lngLoop = lngLoop + 1
rs.MoveNext
Loop Until rs.EOF
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
I'd appreciate any advice!
Module Name: GeneralFunctions
Procedure Name: SequentialNumber
The program won't execute the sub; it simply stops at the first line of it and pulls up the "General Functions" screen as though I'm debugging. I can click the "Run" menu option and it will execute, but it won't do so automatically. Here's the sub:
Public Sub SequentialNumber()
Dim db As Database
Dim rs As Recordset
Dim lngLoop As Long
Set db = CurrentDb
Set rs = db.OpenRecordset("PeopleSoftOut2")
lngLoop = 1
Do
rs.Edit
rs!FileLine = lngLoop
rs.Update
lngLoop = lngLoop + 1
rs.MoveNext
Loop Until rs.EOF
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
I'd appreciate any advice!