Active Member
December 17, 2020
Hi, am new to this forum need support on the below.
In User form Textbox A is the Data Input text. Textbox Min is the minimum value & Textbox Max is the maximum value.
I need to Validate Textbox A with Textbox Min & Textbox Max as below.
Private Sub txtW_1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Val(Textbox A) < Val(Textbox Min) Or Val(Textbox A) > Val(Textbox Max) Then
Textbox A.BackColor = vbRed
Dim strupdate
strupdate = MsgBox("Do you want to Re-Inspect and input the Dimension data again", vbYesNo, "Dimension Out of Spec")
If strupdate = vbNo Then
Textbox A.Backcolor = vbRed
Me.Textbox A.Enabled = False
Me.Textbox B.Enabled = True
Me.Textbox B.setfocus
Else
Me.Textbox A.Enabled = True
Me.Textbox A.Setfocus
Me.Textbox A.Text = " "
End If
End If
End Sub
And i want to loop this code again after user Re-inspect and input the dimension data again.
This Should continue till the User strupdate as VbNo (or) the If Condition met.
Inputs
Username : Any
Machine # : Drop down
ItemCode : 1
Thanks & Regards,
Dilipkumar.H
1 Guest(s)