Results 1 to 3 of 3
  1. #1
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16

    Arrow Caption on custom navigation button not updating on sub from

    I am hoping for some Forum Magic. Every time I have posted a problem here I have found the answer within a few minutes of the posting. so Here it goes.
    I have a form that is used to edit order.
    On the main Form I have a tab control.
    On one of the pages(ITEMS) of the tab control I have a sub form that allow the users to page through the items on the order and make changes. Every thing works fine except on the Custom navigation button I created. When the user select the ITEMS tab the subform is displayed but the box that should display "Record 1 of #" do not display. if I go to the next record it displays correctly.
    I have tried setting watch points in my code and it seem that the oncurrent event is not triggering when the user selected the order to edit on the main from. I have tried to set the caption of this button in the onclick event for the tab control.
    Code:
         Private Sub TabCtl71_Change()
         Select Case Me!TabCtl71.Value
         Case 0
              MsgBox ("order infor")
         Case 1
              MsgBox ("buyer info")
         Case 2
              MsgBox ("items")
              Me![edit_order_items_subform].Form!tblreccount.Caption = _
                 "Record " & Me.[edit_order_items_subform].Form.CurrentRecord & " of " & _
                  Me.[edit_order_items_subform].Form.RecordCount
         Case 3
               MsgBox ("adjust")
         Case 4
               MsgBox ("returns")
    End Select
    then this tries to execute I get this error
    "runtime error 2465 application defined or object defined error"



    The code that I have in the oncurrent event work great when it fires but I cannot figure out a way to cause it to fire.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    What is tblreccount - a button control? Suggest better name would be btnRecCount.

    The debugger doesn't like Form.RecordCount.

    I always name subform container different from the object it holds. This works for me:

    Debug.Print Me.ctrSections.Form.CurrentRecord & " of "
    Debug.Print Me.ctrSections.Form.RecordsetClone.RecordCount
    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
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16
    Thanks for the suggestion. I actually found a way to get my code to work it may not be the cleanest way but it works.
    I have changed the form_current on the subform to public and then when the user clicks on the item tab I call it and it works.
    Thanks again I will of course add to your reputation because you always seem to reply to my posts.

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

Similar Threads

  1. Navigation Pane not automatically updating
    By thebigthing313 in forum Access
    Replies: 4
    Last Post: 02-05-2014, 09:04 AM
  2. loading a button caption to a global variable
    By texanmike02 in forum Access
    Replies: 7
    Last Post: 11-14-2013, 11:36 AM
  3. VBA caption button of record
    By Ruegen in forum Forms
    Replies: 4
    Last Post: 08-19-2013, 05:03 PM
  4. Navigation Bar Record Count not updating
    By ylatodd in forum Forms
    Replies: 27
    Last Post: 02-13-2012, 10:45 AM
  5. Combo Box Filters for custom navigation
    By hobsondm01 in forum Forms
    Replies: 1
    Last Post: 07-05-2011, 09:58 AM

Tags for this Thread

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