• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

VB6 form make a field mandatory

The field Lot Number (txtLotNumb) needs to be mandatory.  From what I see this is not a property setting. The sub routine seen below is the code associated with the field.  How would I make this filed mandatory?
Thanks in Advance

Private Sub txtLotNumb_Change()

End Sub

For a complete picture see the attached file.
Thanks in Advance
The-field-Lot-Number.docx
0
tesla764
Asked:
tesla764
  • 2
  • 2
1 Solution
 
advfinanceCommented:
How about, somewhere in cmdSave_Click()...

If Len(Trim(txtLotNumb.Text)) = 0 Then
    MsgBox "Please enter lot number.", "Item Allocation", vbInformation
    Exit Sub
End If

Open in new window


--
Chris
0
 
tesla764Author Commented:
I will try this in a few minutes. Thanks.
0
 
tesla764Author Commented:
This is something I can definately work with.
Thanks you for pinting me in the right direction.
0
 
advfinanceCommented:
You're welcome Merle. Happy coding.

--
Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now