Results 1 to 3 of 3
  1. #1
    wakerider05 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013

    Having to convert database from 2010 to 2003, wth global variables

    Hi all,

    I have an access database that has a “user login” section. When that user logs in, it stores their username as a global variable, so I can call it on other forms for security purposes.
    Meaning If I log in as John Doe, and I fill out a form, there is an E Signature area that is automatically populated with John Doe.

    However my client only has Access 2003, I saved the database as 2003 no problem, except I got an error on my forms that use the global variable that says it cannot save because of the module of the Global variables. I need some way to get the value of the logged in user into those forms that need the E-Signature.
    Two questions:
    Can I still use the global variable process?
    What’s another way I can get them in their?

    my glabal variables stored in a module:

    Option Compare Database
    Global gstruser As String
    Option Explicit

    than on the form i have the code
    Text42.Value = gstruser

    Thanks guys, I hope this makes sense.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    The Great Land
    As far as I remember, Access 2003 accommadated global variables.

    The alternative is to not use global variable and store the user login info directly to textbox on a form that never closes. That is what I do.

    I tried global variables but was aggravated by them in debugging because if code execution is interrupted the variable loses value.
    How to attach file: To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Richmond (Virginia, not North Yorkshire!)
    Quote Originally Posted by June7 View Post

    ...As far as I remember, Access 2003 accommadated global variables...
    That's correct!

    Quote Originally Posted by June7 View Post

    ...I tried global variables but was aggravated...because if code execution is interrupted the variable loses value...
    Also true! The new TempVars, introduced in 2007, supposedly resolved this problem.

    Conversion , especially backward conversion, often has hiccups. I wonder if the problem doesn't lie with how you're setting the value of the Variable, rather than with the line

    Text42.Value = gstruser

    The syntax for doing some things, especially those associated with using Envir(), and such, changed between 2003 and 2007, I believe.

    Linq ;0)>
    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Migrating database and app from 2003 to 2010
    By 3. BCCShelper in forum Access
    Replies: 1
    Last Post: 10-15-2012, 08:25 AM
  2. Replies: 2
    Last Post: 12-23-2011, 08:22 AM
  3. Setting global variables
    By Remster in forum Programming
    Replies: 1
    Last Post: 08-24-2011, 08:47 AM
  4. Replies: 9
    Last Post: 08-07-2011, 11:21 AM
  5. Convert access 2003 to access 2010
    By Vera in forum Access
    Replies: 3
    Last Post: 07-16-2010, 11:01 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