Results 1 to 5 of 5
  1. #1
    TatianaVBA is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    2

    Question Making a button disappear upon conditions


    Hi, everyone! How do I make a button "Previous" disappear upon the beginning of the recordset and button "Next" disappear upon the end of that recordset in Access 2010? Thanks so much for your help!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are they *your* buttons or the ones on the NavigationBar at the bottom of a form?

  3. #3
    TatianaVBA is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    2
    Quote Originally Posted by RuralGuy View Post
    Are they *your* buttons or the ones on the NavigationBar at the bottom of a form?

    The ones on the NavigationBar at the bottom of a form

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That is little chance you can modify that control but you could modify your own nav control: http://www.lebans.com/recnavbuttons.htm

  5. #5
    narang is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    4
    Quote Originally Posted by TatianaVBA View Post
    Hi, everyone! How do I make a button "Previous" disappear upon the beginning of the recordset and button "Next" disappear upon the end of that recordset in Access 2010? Thanks so much for your help!
    Hello,

    You may try the following, kindly test at your end

    Command9 - Previous Button
    Command12 - Next Button

    We are assuming that the Forms Navigation property is set to No

    Private Sub Command9_Click()
    DoCmd.GoToRecord acDataForm, Me.Name, acPrevious
    Me.RecordsetClone.Bookmark = Me.Bookmark
    Me.RecordsetClone.MovePrevious
    If Me.RecordsetClone.BOF = True Then
    Me.Controls("command12").SetFocus
    Me.Controls("command9").Visible = False
    End If
    Me.Controls("command12").Visible = True

    End Sub


    Private Sub Command12_Click()
    DoCmd.GoToRecord acDataForm, Me.Name, acNext
    Me.RecordsetClone.Bookmark = Me.Bookmark
    Me.RecordsetClone.MoveNext
    If Me.RecordsetClone.EOF = True Then
    Me.Controls("command9").SetFocus
    Me.Controls("command12").Visible = False
    End If

    Me.Controls("command9").Visible = True
    End Sub


    Private Sub Form_Open(Cancel As Integer)
    Me.Controls("command9").Visible = False
    End Sub

    Rgds

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

Similar Threads

  1. making button image animated
    By chickenguru in forum Forms
    Replies: 0
    Last Post: 05-23-2012, 10:12 PM
  2. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  3. Replies: 5
    Last Post: 03-13-2012, 12:28 PM
  4. Making an inactive button Help
    By ericfatherree in forum Programming
    Replies: 2
    Last Post: 02-05-2012, 11:05 PM
  5. Replies: 2
    Last Post: 03-13-2009, 08:35 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