Results 1 to 2 of 2
  1. #1
    ramirezx@ddmfg.com is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    40

    MS Access Form message "No current record." box appears?

    Hi,



    I have VBA code in On Active with the following below. I have this so when the form is active it will re-query and stay on the current record it's on. It works great, but when no records exist I get this error:

    Private Sub Form_Activate()

    Me.Recordset.Requery

    End Sub

    Can I add some code that when it finds no records, to just cancel it and just do a Me.Requery instead of Me.Recordset.Requery?




    Thanks,
    Xavier

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Always best to avoid errors. In this case it might be by using a more suitable event - not sure which in your case but maybe Current event. If all else fails trap the error and just Resume Next for that error only.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 2
    Last Post: 09-01-2016, 11:00 AM
  2. Replies: 10
    Last Post: 09-03-2015, 01:31 PM
  3. Replies: 3
    Last Post: 01-27-2014, 02:45 PM
  4. Replies: 2
    Last Post: 11-12-2013, 07:06 PM
  5. Replies: 0
    Last Post: 05-04-2010, 06:39 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