Results 1 to 3 of 3
  1. #1
    pncbiz is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Jul 2020
    Location
    Maryland
    Posts
    66

    Carry over data question

    I have a main form (Contracts) with a subform (subProduct). User enters contract details including the contracted company, then moves to the subform to select the Product Vendors and Products. For example, contract with Company A to sell three of Company's B's products (as well as Company C's, D's and E's, as applicable).



    The list of products can be quite long for each contract, so I implemented carry over code (Allen Browne's) that works great when editing a contract. However, when entering a new contract, the carry over pulls the data from the previous product record, which is wholly irrelevant.

    I'd like to have the carry over ONLY carry over data within the current contract, and not reach into the products associated with the last contract entered. Is that possible?

    Thanks,
    Phil

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Code is setting DefaultValue property?
    When moving to new record row on main form, set subform controls DefaultValue to empty string. Use main form Current event.

    If Me.NewRecord Then
    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.

  3. #3
    pncbiz is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Jul 2020
    Location
    Maryland
    Posts
    66
    Just wanted to follow up on this - wound up deleting the code altogether. As I dug into it a little more, I realized users wouldn't need much carryover, and just setting default values with VBA when needed would be enough. Thanks for your time!

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

Similar Threads

  1. Replies: 2
    Last Post: 02-12-2015, 05:14 AM
  2. Replies: 8
    Last Post: 01-13-2015, 10:27 PM
  3. Carry data from one form to another.
    By Tewbrainer in forum Forms
    Replies: 3
    Last Post: 10-27-2011, 04:33 PM
  4. Replies: 26
    Last Post: 01-09-2011, 05:30 PM
  5. Replies: 0
    Last Post: 01-03-2011, 03:38 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