Popup for Required Field

tbpowers

Board Regular
Joined
Jul 16, 2008
Messages
89
I have a field on my form that, once populated, will close the record and lock down the fields. However there is one field that I want to require before allowing the user to close the record. How would I accomplish this? I would also like to create a message that states "The Qty field must be populated before you can close". Any help will be greatly appreciated.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
In the form's BeforeUpdate event put something like:

Code:
If Len(Me.YourTextBoxName & "") = 0 Then
    If MsgBox("You must populate the XXX field before closing.  Do you still want to close?", vbQuestion + vbYesNo, "Close?") = vbYes Then
       Cancel = True
    Else
       Cancel = True
       Me.Undo
    End If
End If
 
Upvote 0
The code worked fine, but I am wanting to do something a little different. I want to lock a field based on another field.

The field that locks the form holds the initials of the user. When they try to type in their initials I want it to popup the message and require that the qty field be populated before they will be allowed to initial.
 
Upvote 0
The code below works, I just don't know how to get it to throw the message "Actual Defect Qty must be entered" when a user tries to enter their initials.

Private Sub Disposition_App_QA_Click()
If IsNull(Actual_Defect_Qty) Then
Me.Disposition_App_QA.Locked = True
Else
Me.Disposition_App_QA.Locked = False
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,590
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top