Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REQUIRE IMPUT ON TEXT BOX WITH CUSTOM POPUP BOX

Status
Not open for further replies.

HerickP

IS-IT--Management
May 10, 2000
68
US
Hi,<br><br>I have a database and users sometimes leave some fields in blank in a form, where they were not supposed to. If I go in Table Design View, I have the &quot;Required field Property&quot; set to &quot;yes&quot; but I would like to have a custom popup message to show when the user leaves the specific text box blak...something like &quot;This is a required field. Please try again&quot;. whats the code??<br><br>Thanks once again.
 
This is just one method<br>---------------------<br>Private Sub Form_AfterUpdate()<br>&nbsp;&nbsp;&nbsp;&nbsp;If Me![FirstName] = &quot;&quot; Or IsNull(Me![FirstName]) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox &quot;Please key in The FirstName&quot;, vbExclamation, &quot;Missing Info&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me![FirstName].SetFocus<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;If Me![LastName] = &quot;&quot; Or IsNull(Me![LastName]) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox &quot;Please key in The LastName&quot;, vbExclamation, &quot;Missing Info&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me![LastName].SetFocus<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>End Sub<br><br>----------------<br><br>Now it seems a little redundant but, if the data is missing it brings them back to the exact text box where the data is missing. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top