Results 1 to 3 of 3
  1. #1
    rcerda is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    18

    VBA to pass a value

    Hi,



    I need to pass a value generated whenever a sub is processed (a boolean True/False) and check its value in another function to have it take some action in case is True. I have tried with ByVal, ByRef but have not been successful. Whenever I go check the value in the function I need the value is Null so I can not complete the algorithm. I would appreciate if someone knows how to keep the value from one sub to a function.

    thank you

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Show us your function and sub. Hopefully there is some description with each.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can declare the variable in a standard module, so its value is available at any time. You can also have your sub be a function and have it return the true/false value.
    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. Pass a variable to a Pass Through Query
    By violeta_barajas in forum Access
    Replies: 2
    Last Post: 01-26-2017, 07:59 PM
  2. Replies: 5
    Last Post: 04-27-2015, 02:40 PM
  3. Replies: 7
    Last Post: 03-11-2015, 12:48 PM
  4. Replies: 22
    Last Post: 06-26-2014, 03:05 AM
  5. pass thru qry
    By slimjen in forum Forms
    Replies: 5
    Last Post: 07-18-2012, 09:36 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