Results 1 to 12 of 12
  1. #1
    sparkyinak is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    22

    Modifying the Navigation Bar

    I would like to build a customized Navigation Bar where the buttons used are bigger and eliminate the items not needed. The issue I will run into I would like to keep my "Current Record" window that shows "X of Y" number of records and make it bigger to read too. Is there a way to a custom window that will auto adjust just like the one on the Navigation bar when filtering or querying data?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    With textboxes, command buttons, and VBA code.
    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
    sparkyinak is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    22
    I got that. Not sure where to begin with the VBA.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Something like this?

    Click image for larger version. 

Name:	Capture.PNG 
Views:	14 
Size:	3.9 KB 
ID:	38033
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    sparkyinak is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    22
    Yes. My VBA is limited so I didn’t know where even to start on the current record code

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    add a label and call it lblPos or similar

    In Form_Current event, add code like this:

    Code:
    Private Sub Form_Current()
    
    Dim N as Integer
    N = DCount("*", "YourTableOrQueryName")
    
    Me.lblPos.Caption = Me.CurrentRecord & " of " & N
    
    End Sub
    It will update automatically when you change records
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Well, DCount will not give the correct count if filter is applied to form. Use Count instead of DCount:

    Me.lblPos.Caption = Me.CurrentRecord & " of " & Me.Count

    I tried an expression in textbox ControlSource property but the CurrentRecord value would not update when navigating records.
    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.

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    I copied the code from one of my apps where I've used it for many years
    Using Form_Current, the display will definitely update when you change records
    However, I forgot OP wanted to filter records.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    In attempt to avoid VBA, I tested CurrentRecord in an expression in textbox ControlSource and it would not update when navigating.
    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.

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Hi June
    Yes you said that already in post #7.
    But to repeat the code I wrote does work and I've been using code like that for years in multiple apps.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Yes, I understand DCount() works under the proper conditions. Surely it would have to reference a query uses dynamic parameters that are the same parameters that filter the form and/or the query is the form RecordSource? I don't use dynamic parameterized query. Hence, my alternate suggestion.

    And again, CurrentRecord referenced directly in textbox ControlSource expression does not work. Has to be provided by VBA as we both suggest.
    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.

  12. #12
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    I think we are at cross purposes here
    I meant using Form_Current works.
    However, as I'd already mentioned, I forgot user wanted to filter so using DCount won't work for the total record count (unless filter criteria were used)
    Typically I use a recordset count to get the total records after filtering.
    For example the the Student Target Group Explorer example in this link Multiple Group & Filter

    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 3
    Last Post: 10-03-2022, 12:39 PM
  2. Replies: 5
    Last Post: 03-02-2015, 02:14 PM
  3. Replies: 5
    Last Post: 12-09-2014, 02:38 PM
  4. Replies: 5
    Last Post: 11-04-2014, 08:13 AM
  5. Modifying a function
    By sjs94704 in forum Programming
    Replies: 5
    Last Post: 12-10-2012, 02:10 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