Results 1 to 5 of 5
  1. #1
    sgreenman is offline Novice
    Windows 10 Office 365
    Join Date
    May 2020
    Posts
    6

    Transferring Data from one form to another

    I am having a problem getting the information i entered in one form to transfer over to another. I want to take the data entered in specific fields and auto fill them into another form i open using DoCmd.OpenForm. Any help would be greatly appreciated. Below is a snippet of the VBA code i am trying to use. I am green when it comes to VBA and Access so i am probably doing this completely wrong.

    Code used:

    Dim ID As Long

    DoCmd.OpenForm "JobLogForm"



    DoCmd.GoToRecord , , acNewRec

    ID = DMax("JobID", "JobList")
    JobIDCopy = ID
    JobLogRecDate = Dlookup("JobRec", "JobList", "JobID=" & ID)
    JobLogDueDate = Dlookup("JobDueBy", "JobList", "JobID=" & ID)
    JobLogDes = Dlookup("JobDes", "JobList", "JobID=" & ID)

  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
    Along the lines of:

    Forms!JobLogForm.TexboxName = JobIDCopy
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    You don't need to replicate the last three fields as it goes against good relationship database design, you just need to store the newly created JobID and you can get the rest anytime you need in a query by joining this table to JobList by ID to JobID.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    sgreenman is offline Novice
    Windows 10 Office 365
    Join Date
    May 2020
    Posts
    6
    Thanks for the tips ill try and figure it out as i said i am new to access and i am still figuring out how the relationships work.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Maybe you need a form/subform arrangement.

    Main form bound to JobList and subform bound to JobLog.

    JobID will automatically populate into new record of subform.
    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.

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

Similar Threads

  1. Transferring Data
    By Kundan in forum Forms
    Replies: 3
    Last Post: 11-21-2018, 10:21 PM
  2. Transferring Data From Excel
    By garrettgivre in forum Access
    Replies: 2
    Last Post: 09-17-2013, 12:30 PM
  3. Replies: 9
    Last Post: 12-27-2011, 01:06 PM
  4. Transferring data to a second form
    By JayX in forum Access
    Replies: 2
    Last Post: 12-15-2011, 11:31 AM
  5. Replies: 1
    Last Post: 09-07-2011, 02:45 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