Results 1 to 3 of 3
  1. #1
    Malalex is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    2

    Question Call Click event in nagivation button from subform

    Hi there,
    I have a navigation form which has 2 tabs. One is contains all the records in the table, I show them using a datasheetview, the 2 tab ( or navigation button) shows the details of the records.


    this works ok, the user select the record in the datasheetview and can click in the 2 tab to see more details.
    But the the user wants to access the 2 tab wen double clicking in a a record in the datasheetview. I thought was easy.. :-/ . but I have problems

    What I have done is:

    1) on event Double click of the datasheetview I put the setfocus in the tab 2

    Me.Parent.Parent!NavigationButton9.SetFocus

    2 ) in the gotfocus of tab2 I call the click event

    Call NavigationButton9_Click



    When I hit the click event Access crashes... So obviously I cannot use this approach...


    I have access 2016. Any idea on how to tackle this?

    Thanks!

    Alex

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,930
    Navigation forms have their limitations, but on the basis the form is open, try

    1. change the Private for the event to Public (so it can be referenced from outside the form)
    2. then instead of your call, use Form_nameofyourform.NavigationButton9_Click


    may not work because it is a navigation form, but that is how you call subs and functions in other forms

  3. #3
    Malalex is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    2
    Hi Ajax, thanks for your reply. I found the way to trigger the event without breaking Access
    I set the focus and sent the enter from the double click event in the subform.
    It is kinda slow but works

    Private Sub Form_DblClick(Cancel As Integer)




    Forms![Navigation form]!NavigationButton9.SetFocus
    SendKeys "{enter}", True


    End Sub

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

Similar Threads

  1. External script to call Command Button Click event handler
    By Sean Nakasone in forum Programming
    Replies: 5
    Last Post: 10-29-2014, 12:35 PM
  2. Trigger event with button click
    By AMAS in forum Forms
    Replies: 8
    Last Post: 06-07-2012, 09:42 AM
  3. Call a subform event from the main form
    By bonecone in forum Programming
    Replies: 2
    Last Post: 05-02-2012, 11:36 AM
  4. Command button click event
    By R_jang in forum Programming
    Replies: 10
    Last Post: 10-29-2010, 10:13 PM
  5. On Click Event For Button On Form
    By Desstro in forum Forms
    Replies: 3
    Last Post: 08-09-2010, 02:36 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