Solved

Access Required Fields

Posted on 2014-04-25
2
246 Views
Last Modified: 2014-04-25
I'm using the following code and it works fine for the most part, however it allows the user to move to the next record after the second  attemp without entering the date resolved. How do I require the user to enter the date resolved before moving to the next record.

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not IsNull(Me.ResolveCode) And IsNull(Me.DateResolved) Then
MsgBox "Please enter the Date Resolved", vbExclamation, "FSB GovTrip"

        Me.DateResolved.SetFocus
       
       Exit Sub
    End If

   
 
 
End Sub
0
Comment
Question by:shieldsco
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40022456
Do:

Cancel = True

which tells Access to cancel the update of the control.   No need to do the set focus.  The focus will remain on the control.

Jim.
0
 

Author Closing Comment

by:shieldsco
ID: 40022515
Thanks
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question