MsgBox not alerting at appropiate time

tmdrake

Registered User.
Local time
Today, 16:28
Joined
Mar 20, 2013
Messages
15
I have a form where the is an unbound textbox in header of the form where the user will enter how many weld are scanned before a pull test is performed. Next to it are two text boxes counting the scans, example: 1 of 5.
Once the interval of 5 is reached a msgbox appears telling the user to perform a test. Now the problem is the msgbox does not appear until the sixth record is scanned. I sure hope this makes sense,not sure how to fix this problem. Below is the code I am using:


Private Sub Form_AfterInsert()
If Not IsNull(Me.SN.Value) Then
LastPosSN = Me.SN.Value
End If
If PosPullTestCount = Me.PullTestNum.Value Then
MsgBox "Time to perform a pull-test on a scrap cell!"
PosPullTestCount = 1
Me.Text30.Value = Me.PullTestNum.Value
DoCmd.OpenForm "GeneralTabPullTest"
Else
PosPullTestCount = PosPullTestCount + 1
Me.Text30.Value = Me.PullTestNum.Value
End If
End Sub


Thanks
 
Not sure which one it will be but if you change this bit of code to

Code:
If PosPullTestCount = Me.PullTestNum.Value[COLOR=red]-1[/COLOR] Then 

 
or 
 
If PosPullTestCount[COLOR=red]-1[/COLOR] = Me.PullTestNum.Value Then
 
Thank you, that worked.l:):)
 

Users who are viewing this thread

Back
Top Bottom