Results 1 to 4 of 4
  1. #1
    Thomman is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    8

    Pass variable name to another forms


    Hi Friends,
    In my multiuser application, I am using my custom login screen. I need to trap the username from the custom login form and save the username in all the tables whenever an addition / modification of records happens. How can I pass the Username variable to another forms in Ms access?

    Thanks

  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,521
    One common solution is to hide rather than close the login form (set Visible = False). Then you can simply refer to it in other forms or code to get the user:

    Forms!FormName.TextboxName

    You can also use a global variable and a public function that returns its value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Thomman is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    8
    Thanks. I already used public variable but it returns only blank!!! Let me try this.. thnx again.

  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,521
    No problem; post back if you get stuck.
    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 Variable to Table Field with VBA
    By dgj32784 in forum Programming
    Replies: 3
    Last Post: 03-28-2011, 09:36 PM
  2. Pass Variable Values From One Form to Another
    By Nokia N93 in forum Forms
    Replies: 3
    Last Post: 03-07-2011, 11:47 AM
  3. VBA Pass-through Query with Variable
    By smaumau in forum Programming
    Replies: 0
    Last Post: 12-06-2010, 09:10 AM
  4. Replies: 5
    Last Post: 04-05-2010, 11:43 AM
  5. pass a variable to the MsgBox function
    By 3dmgirl in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 07:14 AM

Tags for this Thread

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