Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    Join Date
    Jun 2023
    Location
    Jacksonville, FL
    Posts
    26
    Ok I have news. I turned the Navigation button property to off. Opened the form, all the nav buttons are disabled BUT if you click the NEW button and that will activate the buttons and they will work normally. If you exit and reopen the form then you have to click the New button again. Does this help?

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by PlayerPianoMan View Post
    Ok I have news. I turned the Navigation button property to off. Opened the form, all the nav buttons are disabled BUT if you click the NEW button and that will activate the buttons and they will work normally. If you exit and reopen the form then you have to click the New button again. Does this help?
    I am not sure what you are doing?
    Moke's class has nothing to do with the Access navigation buttons?
    I just downloded his DB and set them to No, and his buttons work fine?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #18
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    So there are 3 options with my code. Cycle the recordset, disable the buttons, and a message box.

    Your issue only occurs with the disable option. I tried the other 2 options and they seem to work fine.

    baffling.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #19
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    LighthouseCollection-PPM-davegri-v01.zip

    See if this works for you.

  5. #20
    Join Date
    Jun 2023
    Location
    Jacksonville, FL
    Posts
    26
    I have more information. I opened and brand new database, put in a table and form and tried the navigation buttons. Same issue. However I accidentally clicked the new button when the form came up and all the navigation buttons now worked and they worked fine until I exited and then reopened for form. Once again I clicked the New button and everything was ok. I have attached a screen shot of the Current Database settings in Access Options menu.
    Attached Thumbnails Attached Thumbnails Access Options - Current Database.jpg  

  6. #21
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    @Dave

    Any insight as to why with my class the buttons are being disabled when the nav button property is changed?
    It shouldn't happen as far as I know. I find it a little disturbing.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  7. #22
    Join Date
    Jun 2023
    Location
    Jacksonville, FL
    Posts
    26
    I also wonder if there is a form setting that could be causing this? I am at a loss.

  8. #23
    Join Date
    Jun 2023
    Location
    Jacksonville, FL
    Posts
    26
    That works! What did you do?

  9. #24
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Quote Originally Posted by PlayerPianoMan View Post
    That works! What did you do?
    I adapted your form_current code to the code that I always use for custom navigation.

  10. #25
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    I think I fiqured it out but still don't understand why.

    The form when opened was only loading one record. Therefore it was at BOF and EOF disabling the buttons.

    I added a move last/first to the initiating code and that solved the problem

    Code:
    Public Sub InitCls(frm As Form, bPrev As CommandButton, bNext As CommandButton, Optional bFirst As CommandButton = Nothing, Optional bLast As CommandButton = Nothing, Optional bNew As CommandButton = Nothing, Optional lCounter As Label = Nothing, Optional Bof_Eof_Action As eRecordAction = 1)
        Set m_objfrm = frm
        Set m_objcPrevious = bPrev: m_objcPrevious.OnClick = fEvents
        Set m_objcNext = bNext: m_objcNext.OnClick = fEvents
    
    
        m_objfrm.OnCurrent = fEvents
    
    
        If Not bFirst Is Nothing Then Set m_objcFirst = bFirst: m_objcFirst.OnClick = fEvents
        If Not bLast Is Nothing Then Set m_objcLast = bLast: m_objcLast.OnClick = fEvents
        If Not bNew Is Nothing Then Set m_objcNewRec = bNew: m_objcNewRec.OnClick = fEvents
        If Not lCounter Is Nothing Then Set m_objLblCount = lCounter
    
    
        TheAction = Bof_Eof_Action
        
        frm.Recordset.MoveLast
        frm.Recordset.MoveFirst
        
    End Sub
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  11. #26
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Surely if it is loading only one record, it cannot be at BOF or EOF?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  12. #27
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Quote Originally Posted by Welshgasman View Post
    Surely if it is loading only one record, it cannot be at BOF or EOF?
    True, but you know what I mean. There was no next record or previous record so all the buttons would disable.
    Technically I should have said the absolute position of the recordset remained at 0. the absolute position is the criteria which makes the code function.

    I put a debug.print me.recordset.recordcount in the onload event. with navigation buttons turned off it was 1, and with it on it was 21.
    Not sure why.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  13. #28
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Ah, I see, sorry, misunderstood.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Custom record navigation buttons on a form
    By peterFisp in forum Forms
    Replies: 5
    Last Post: 09-12-2019, 10:26 PM
  2. Replies: 8
    Last Post: 09-18-2015, 01:52 PM
  3. Navigational Buttons STOP working !!
    By THE STUDENT in forum Access
    Replies: 6
    Last Post: 06-11-2013, 04:20 PM
  4. Buttons STOP working !!
    By THE STUDENT in forum Forms
    Replies: 3
    Last Post: 06-10-2013, 08:11 PM
  5. Navigation Buttons Stop My Code
    By millerdav99 in forum Programming
    Replies: 6
    Last Post: 03-18-2011, 11:13 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