Results 1 to 3 of 3
  1. #1
    hockeyman9474 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Location
    Manalapan, NJ
    Posts
    45

    Display information from current recordset

    My record set is opened on form load. I have 2 buttons (next & previous) on a form that displays records from my recordset which is a table. I can add the default buttons to move through the records, but I also have a separate module that gets called each time it is clicked that does something else. So I need to program it all from scratch. Each button is programmed to move next or previous as long as the recordset is not not EOF or BOF. I should also add that one of the controls on the form is a date and I'd like to search records using a date picker.

    called on form load
    Public Sub openRecordset()
    Set db = CurrentDb
    Set rs = db.openRecordset("Exceptions")
    End Sub

    Next record Button


    Private Sub btnNext_Click()
    If rs.EOF = True Then
    MsgBox ("End of File")
    Else
    rs.MoveNext
    loadButtons
    End If

    Prev Record Button
    Private Sub btnPrev_Click()
    If rs.BOF = True Then
    MsgBox ("BOF")
    Else
    rs.MovePrevious
    loadButtons
    End If

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    These buttons already exist. in the form, format tab,
    turn on NAVIGATION BUTTONS = YES

    no programming needed. no time lost.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    As ranman256 said, this kind of thing is done automatically by Access, when using a Bound Form, which is one of the main reasons for using Access, it allows for rapid development of a database with a minimum amount of coding. You appear to be attempting to use an Unbound Form, not really something for the faint of heart, and certainly not something for a beginner. Why are you taking this approach?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Print a report from current recordset with no fields
    By themushroomking in forum Access
    Replies: 8
    Last Post: 07-07-2017, 01:54 PM
  2. Replies: 5
    Last Post: 07-27-2014, 11:04 PM
  3. Replies: 3
    Last Post: 04-12-2012, 05:09 PM
  4. Information message on current event
    By justauser in forum Forms
    Replies: 5
    Last Post: 02-07-2012, 12:15 PM
  5. Join A Recordset to the current db Table
    By mjellis in forum Programming
    Replies: 0
    Last Post: 08-10-2010, 02:44 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