Results 1 to 4 of 4
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    Programmatically insert text string into subform control


    How do I add a text string into a subform control from a button on the main form? I've tried...

    Code:
    Forms!SubFormName!SubFormControl = "MyString"

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Here's a handy reference on the correct syntax:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    Thanks.

    I also want to be able to execute a button on the subform using vba. Would you happen to know would syntax would be appropriate there?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If I were going to be calling code from multiple locations, I'd make it a public function. You can call a button with the same syntax but ending with

    ButtonName_Click

    just as appears in the code for the button.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Hide each control, control group or subform?
    By BRV in forum Programming
    Replies: 2
    Last Post: 12-09-2011, 09:36 AM
  2. Replies: 5
    Last Post: 11-16-2011, 07:30 PM
  3. Text control to act like combo control
    By chris.williams in forum Programming
    Replies: 2
    Last Post: 11-11-2011, 10:12 PM
  4. Replies: 5
    Last Post: 10-13-2011, 03:36 PM
  5. Using a string variable to specify a control
    By Gerry in forum Programming
    Replies: 3
    Last Post: 04-14-2010, 02:28 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