Hello,
I have a sub that loops around a number of records displayed by a form. In side that code anything I put
after the loop does not get executed. Any hints?
In my example below I want after the loop is finished
to go back to the original position the form was at when the user called the routine by clicking a button.
Thanks.
Dim lastposition As String
Me.BacktoMenu.SetFocus
Me.ValidateSelected.DefaultValue = 0
Me.ValidateSelected.Enabled = False
DoCmd.GoToRecord , , acFirst
Do While Me.CurrentRecord <> 0
If Me.VALIDATED = 2 Then
Me.VALIDATED = 1
If SRC_FLAG.Value = "PHD" Then
MODIFIED_PHD_CONFIDENCE.Value = 100
DAYINSERTED.Value = Now()
MODIFIEDBY.Value = Forms!OrionLogonScreen!UserName
End If
End If
DoCmd.GoToRecord , , acNext
Loop
'This code below is not executing or anything I put after the loop.
lastposition = Me.CurrentRecord
DoCmd.GoToRecord , , acGoTo, lastposition
I have a sub that loops around a number of records displayed by a form. In side that code anything I put
after the loop does not get executed. Any hints?
In my example below I want after the loop is finished
to go back to the original position the form was at when the user called the routine by clicking a button.
Thanks.
Dim lastposition As String
Me.BacktoMenu.SetFocus
Me.ValidateSelected.DefaultValue = 0
Me.ValidateSelected.Enabled = False
DoCmd.GoToRecord , , acFirst
Do While Me.CurrentRecord <> 0
If Me.VALIDATED = 2 Then
Me.VALIDATED = 1
If SRC_FLAG.Value = "PHD" Then
MODIFIED_PHD_CONFIDENCE.Value = 100
DAYINSERTED.Value = Now()
MODIFIEDBY.Value = Forms!OrionLogonScreen!UserName
End If
End If
DoCmd.GoToRecord , , acNext
Loop
'This code below is not executing or anything I put after the loop.
lastposition = Me.CurrentRecord
DoCmd.GoToRecord , , acGoTo, lastposition