Results 1 to 3 of 3
  1. #1
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131

    Stay on current Field


    I have error handling code on a field (After Update) in a form that is, if a directory does not exist the user needs to create the directory. I want the user to stay on the current field and not move on until the directory is created. I tried gotorecord and several other commands but nothing is working. How can I accomplish this?


    Err_MissingQuarter:
    MsgBox "An error has occured, please make sure that the Year and Quarter Directory has beern added to the [J:\Sales Dept\] Reports directory"
    Me.ResearchDate.Undo

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Try with before update event.
    Logic -
    If DirectoryExists=False then
    Cancel=True
    Endif

  3. #3
    KathyL is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    With your event procedure, add a line to set the focus to whatever field you want, like:
    me.fieldname.SetFocus

    Cancel could lose everything else the User entered, so think your logic through.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Requery But Stay on Same Record
    By burrina in forum Forms
    Replies: 1
    Last Post: 12-18-2012, 03:08 PM
  2. Refilter form and stay on same record
    By ny1994rangers in forum Forms
    Replies: 1
    Last Post: 04-17-2012, 12:04 PM
  3. Access won't stay maximised
    By eckles in forum Access
    Replies: 7
    Last Post: 06-21-2011, 01:55 AM
  4. Report data to stay on one page
    By appleb007 in forum Reports
    Replies: 3
    Last Post: 04-27-2011, 09:27 AM
  5. Length of Stay
    By lhysell in forum Queries
    Replies: 1
    Last Post: 02-02-2011, 10:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums