Forum

Validating the Text...
 
Notifications
Clear all

Validating the Textbox value between min & max textbox value with If condition

3 Posts
2 Users
0 Reactions
126 Views
(@dilipuma200011)
Posts: 3
Active Member
Topic starter
 

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

 
Posted : 18/12/2020 8:47 am
(@rhysand)
Posts: 80
Trusted Member
 
Hello everyone,
 
the file attached by you must be corrupted, I can't download it, can you upload it again?
 
 
Miguel,
 
Posted : 19/12/2020 10:25 am
(@dilipuma200011)
Posts: 3
Active Member
Topic starter
 

Hi,

 

Find the file attached

 

Dilipkumar.H

 
Posted : 22/12/2020 3:40 am
Share: