Page 3 of 3 FirstFirst 123
Results 31 to 33 of 33
  1. #31
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, the question that I have to ask is this.



    I have been working with examples that are subforms and associated VBA code. Now I must change the Sub updateButtons VBA to reflect what is on that subform. So to do that I must see the subform and the only way to do that is to open up its main or parent form. To open up its main or parent form is to know from the subform what its main or parent form is.

    That is my question. If I know the subform's names, how do I find the main or parent for, to open it and see the subform


    If I do not know this I certainly cannot modify the controls in the Sub updateButton subprogram to reflect what i on the subform.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  2. #32
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Quote Originally Posted by pbaldy View Post
    In looking for controls, I feel like you're going about it the wrong way. You have the code on frmPersonnel. What do you want it to do? What controls on that form do you want to enable? Decide that, find their names and adjust the code.
    Sub updateButtons

    When you say adjust the code you mean adjust the code in Sub updateButtons()?


    Regarding calling the function, it doesn't have any arguments, so there shouldn't be anything after the function name. As you have it in your code:

    but in some lines of my code there are arguments, for example :

    DoCmd.RunMacro "FormHeading", , ""

    which I wrote like this

    FormHeading ", , "

    the compiler did not complain so i think it is at least syntactically correct. Is it functionally correct?

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed


    which I wrote like this

  3. #33
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Quote Originally Posted by Lou_Reed View Post
    but in some lines of my code there are arguments, for example :

    DoCmd.RunMacro "FormHeading", , ""

    which I wrote like this

    FormHeading ", , "

    the compiler did not complain so i think it is at least syntactically correct. Is it functionally correct?
    Apples and oranges. The first runs a macro, the second runs a function. The RunMacro action has arguments, your function does not. You might not get a compile error, but I'd suspect a runtime error since the function isn't expecting an argument.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help with NPV Macro Code in VBA
    By BigNasty in forum Macros
    Replies: 6
    Last Post: 11-21-2016, 10:39 PM
  2. Setting Code to Simple Numeric Age
    By wes9659 in forum Forms
    Replies: 6
    Last Post: 08-14-2014, 01:22 PM
  3. Setting Report Height In Code
    By ccordner in forum Reports
    Replies: 1
    Last Post: 12-07-2012, 10:26 PM
  4. VBA code/Macro help please.
    By Davidyam in forum Access
    Replies: 1
    Last Post: 02-26-2012, 09:59 PM
  5. Replies: 10
    Last Post: 01-04-2012, 01:43 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