I have a form where I need to compare two values and modify another just prior to updating the record. I'm using this code to do this.
Problem is when I press a record navigation button the code is run but next record is not pulled up. Nav works fine unless I make a change that requires this code to be run. Also same situation I have a find button macro that does not work if I make change. I get 144 halt error.
Please help, thank you.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strCurLoc As String
Dim strStoreLoc As String
txtCurLoc.SetFocus
strCurLoc = txtCurLoc
txtStoreLoc.SetFocus
strStoreLoc = txtStoreLoc.Text
If strStoreLoc = strCurLoc Then
txtStatus.SetFocus
txtStatus.Text = "IN"
'lblStatus.Caption = "IN"
'txtCurLoc.SetFocus
Else
txtStatus.SetFocus
txtStatus.Text = "OUT"
'lblStatus.Caption = "OUT"
'txtCurLoc.SetFocus
End If
DoCmd.Save
End Sub
Problem is when I press a record navigation button the code is run but next record is not pulled up. Nav works fine unless I make a change that requires this code to be run. Also same situation I have a find button macro that does not work if I make change. I get 144 halt error.
Please help, thank you.