Results 1 to 9 of 9
  1. #1
    Join Date
    May 2019
    Posts
    65

    Using an array variables globally

    Is there any way to use the values of an array globally? I want to keep track of order of forms as I go from one to another.
    An example would be:
    Form 1
    Go to Form 2
    Go to Form 3
    Go to Form 4
    Return to Form 3
    Return to Form 2


    Return to Form 1

    In the past I’ve used Tempvars!CallForm and Tempvars!ReturnForm. But I’m looking for a better of going back to the previous form.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Are you looking at the process flow for debugging- that is which form does the process logic take me OR
    do you intend to use the array value to open/close a form??

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Array variable would have to be declared as global in a general module header. Then populate the array in some event. Figuring out what event is tricky part.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Join Date
    May 2019
    Posts
    65
    Quote Originally Posted by June7 View Post
    Array variable would have to be declared as global in a general module header. Then populate the array in some event. Figuring out what event is tricky part.
    I was looking for a way to open the form. I’m using:

    Code:
    Docmd.browseto acbrowsetoform, Callform, [RecordID] = Tempvars!RecordID
    The code works, but i have to sometimes open and close many forms and want to back out the same way I want in, as well as go back to the previous specific records. I was trying to use an array that would hold the form name and the RecordID.
    I can use Tempvars, but I’m looking for always to attaché a counter to the Tempvars.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Interesting. Can you tell us a little about the application that uses this? I take it that the more common some logic Open Form, close form, open another form doesn't apply.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Unless user or code has set focus on different forms, closing a form should naturally return focus to form previously opened.

    Not really clear to me what the issue is.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Join Date
    May 2019
    Posts
    65
    Thanks, I am rethinking this process.

  8. #8
    Join Date
    May 2019
    Posts
    65
    Quote Originally Posted by June7 View Post
    Array variable would have to be declared as global in a general module header. Then populate the array in some event. Figuring out what event is tricky part.
    Thanks I’ll look into it.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    What exactly is the process you envision? Even if you jump ahead or return to a Form, wouldn't you Open and Close the form involved?

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

Similar Threads

  1. Replies: 1
    Last Post: 10-16-2019, 03:45 PM
  2. Replies: 3
    Last Post: 02-26-2019, 07:27 PM
  3. CSV into array
    By jasonvanwyk in forum Import/Export Data
    Replies: 7
    Last Post: 02-03-2018, 10:05 PM
  4. Array of variables in a survey database
    By natilton in forum Programming
    Replies: 6
    Last Post: 10-20-2011, 03:19 PM
  5. Globally changing colors on forms
    By pwdpwd in forum Programming
    Replies: 2
    Last Post: 11-23-2010, 09:06 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