Results 1 to 3 of 3
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Within form, advancing to next record

    I have a form that processes orders. The forms' recordset is unprocessed orders. After the user selects to process an order, if the recordset contains no more records, I'd like to display a message, and then close the form. How's the easiest way to handle this? Thank you in advance!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I presume user clicks a button to process order? Here is one way:
    Code:
    Private Sub Process_Click()
    On Error GoTo ErrProc
     
    'your processing code here
     
    DoCmd.GoToRecord acDataForm, Me.Name, acNext
    Exit Sub
    ErrProc:
    If Err = 2105 Then
        MsgBox "End"
        DoCmd.Close
    End If
    End Sub
    I set form properties:
    AllowAdditions NO
    NavigationButtons NO
    CloseButton NO
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks. That worked perfectly!!

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

Similar Threads

  1. If record does not exist, open add new record form
    By RobertIngles in forum Programming
    Replies: 2
    Last Post: 02-01-2011, 08:47 AM
  2. Duplicate last record to next record in form
    By jdhaldane in forum Forms
    Replies: 4
    Last Post: 12-17-2010, 04:22 PM
  3. Replies: 0
    Last Post: 05-04-2010, 06:39 AM
  4. Replies: 3
    Last Post: 06-27-2009, 03:53 PM
  5. Replies: 9
    Last Post: 03-24-2009, 09:19 PM

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