Results 1 to 6 of 6
  1. #1
    Mearntain is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jul 2015
    Posts
    52

    Auto Fill Form Field with Value from Previous Form

    Ok, I've searched around a bit, and can't find a solution that will work for me. Hopefully this is an easy topic:

    I've got one form that a user will start on, titled "Query Form" - Only one text box is here and it is titled "text0"

    Upon hitting enter here, a new form is opened up titled "Time_IN_Form".



    What I would like to do is have the value from text0 on the Query Form to automatically populate Emp_ID on Time_IN_Form so the user doesn't have to enter their employee number twice (only once via the first form).

    What is the best way to do this? I have tried playing with global variables but didnt have any luck with that. Thanks in advance!

  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
    DoCmd.OpenForm...
    Forms!FormName.TextboxName = Me.Text0
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Mearntain is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jul 2015
    Posts
    52
    What is the proper way to type this?

    If I try - Forms!Query Form.text0 = Me.Emp_ID : It gives an error for Compile Error, expected =

    If I try - Forms!"Query Form".text0 = Me.Emp_ID : It gives an error for Compile Error, expected end of statement

    What am I typing in wrong? I tried this method earlier before posting and couldn't get it to work then either. Thanks

  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
    Because of the inadvisable space you need brackets:

    Forms![Query Form].text0 = Me.Emp_ID
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Mearntain is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Jul 2015
    Posts
    52
    Thanks alot! Got it working now

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    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. Replies: 3
    Last Post: 02-25-2015, 04:48 PM
  2. Auto fill from previous cell
    By sajlen1414 in forum Access
    Replies: 4
    Last Post: 04-08-2013, 10:21 AM
  3. Auto Fill a form
    By Suzemt in forum Access
    Replies: 3
    Last Post: 02-18-2013, 11:20 AM
  4. Replies: 3
    Last Post: 03-21-2012, 01:43 PM
  5. Replies: 1
    Last Post: 12-21-2011, 02:11 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