astarbyfar
Registered User.
- Local time
- Today, 10:57
- Joined
- Apr 27, 2003
- Messages
- 93
Just wondering if anyone can help! I have the following code;
Private Sub Tonnage6_AfterUpdate()
If Tonnage6.Value > Press6Max.Value Then
Dim bytResponse As Byte
bytResponse = MsgBox("The tonnage exceeds the maximum allowed. Do you wish to continue", vbYesNo, "Exceeded tonnage")
If bytResponse = vbNo Then ' user selected No
' do your No code here
Me.Tonnage6.SetFocus
Else ' otherwise, user has selected cancel
'do your Yes code
Me.Press5.SetFocus
End If
End Sub
What I need it to do is bring a message box up if the value in Tonnage 6 is > the value in Press6Max. If the user then clicks on Yes then he/she goes to the next field in the tab sequence. Else if they click no the focus is set to and the value highlighted in the field Tonnage 6. Im really poor at VBA and this may be very simple but im really struggling. Thanks for any help
Private Sub Tonnage6_AfterUpdate()
If Tonnage6.Value > Press6Max.Value Then
Dim bytResponse As Byte
bytResponse = MsgBox("The tonnage exceeds the maximum allowed. Do you wish to continue", vbYesNo, "Exceeded tonnage")
If bytResponse = vbNo Then ' user selected No
' do your No code here
Me.Tonnage6.SetFocus
Else ' otherwise, user has selected cancel
'do your Yes code
Me.Press5.SetFocus
End If
End Sub
What I need it to do is bring a message box up if the value in Tonnage 6 is > the value in Press6Max. If the user then clicks on Yes then he/she goes to the next field in the tab sequence. Else if they click no the focus is set to and the value highlighted in the field Tonnage 6. Im really poor at VBA and this may be very simple but im really struggling. Thanks for any help