Results 1 to 5 of 5
  1. #1
    abusaif is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Earth
    Posts
    39

    ADD Record

    Hi there,



    I have two forms form (1) is Item Master and its fields are ItemID, Description, UoM. Form (2) is Transaction form its fields are ID, ItemID & Qty.

    I have Hyperlinked the ItemID field in Item Master by clicking it opens the Transaction Form. At the click event of ItemID when it opens the Transaction Form I want to add a code which could copy the ItemID from Item Master to Transaction form and set focus on Qty.

    Is It Possible?

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Isn't ItemID a Primary Key? If so why would want to do this? Is Transaction a subform? If so are they not linked?
    Me![subformnamehere].SetFocus
    Me![subformnamehere]!controlnamehere.SetFocus
    HTH

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You mean add a new transaction record?
    (this can be done in a single form )

    The item master and a sub form holding the transactions. Then all you do to add a new record is type at the bottom row (like a spreadsheet)
    IT would fill in the itemID.

    Click image for larger version. 

Name:	subform1.png 
Views:	8 
Size:	6.1 KB 
ID:	16717

  4. #4
    abusaif is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Earth
    Posts
    39
    thanks for reply.

    Yes ItemID is a Primary Key in frmItemMaster, where as frmTransaction is an other form.

    Actually what I want is when I receive Something so in frmItemMaster I will click on ItemID so it will open frmTransaction copying ItemID to frmTransaction, so I will only enter the Qty.

    I reached upto this level....

    Private Sub ItemID_Click()
    Dim stDocName As String

    stDocName = "frmTransaction"

    DoCmd.OpenForm stDocName
    DoCmd.GoToRecord , , acNewRec

    End Sub

  5. #5
    abusaif is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Earth
    Posts
    39
    Thanks a TON "ranman256"

    You gave me a nice clue, I really appreciate this but actually I was looking for a code which could copy a value from one form to an other.

    Any how this will also work perfect.

    Once again thanks a lot.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  2. Replies: 3
    Last Post: 02-06-2013, 07:23 PM
  3. Replies: 2
    Last Post: 12-21-2012, 01:57 PM
  4. Replies: 3
    Last Post: 08-26-2012, 10:04 PM
  5. Replies: 5
    Last Post: 08-21-2012, 12:30 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