Results 1 to 3 of 3
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Click manually button on subform - code syntaxis

    Hi,

    I would like to ask you about code to manully click the button on form close:


    Code:
    Private Sub Form_Close()
    
    
    With Form_tbl_Korekty_Main.QryEmployeeForm
    
    
        .Button_back_company_Click
        .Button_back_Click
    
    
    End With
    
    
    End Sub
    but there is an error.
    how can i refer to button on subform within main form and click it ?



    Thank you for answers,
    Jacek Antek

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    There is a component missing.
    it should probably be:
    Form_tbl_Korekty_Main.QryEmployeeForm.form.button_back....

    within the subform object is the form object, and THEN the controls in the form.

    ALWAYS use the builder. It always gets the syntax correct. You can visually pick items from the list.

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you !

    Jacek

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

Similar Threads

  1. Replies: 7
    Last Post: 11-03-2015, 02:43 PM
  2. Skip section of code on button click
    By NovoRapid in forum Modules
    Replies: 2
    Last Post: 02-05-2015, 02:43 PM
  3. Replies: 2
    Last Post: 10-09-2014, 11:37 AM
  4. Replies: 6
    Last Post: 01-11-2013, 11:33 AM
  5. Filter subform on button Click
    By atom in forum Forms
    Replies: 2
    Last Post: 04-18-2012, 09:43 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