Results 1 to 6 of 6
  1. #1
    danyd is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    23

    Need to override where Form field stores data if duplicate value

    I have a Claim table and an Estimate table. The Claim table has a key field called Claim_Number, and the Estimate table has a linked child field with the same name, Claim_Number.

    My Form is based on the following query:
    Code:
    SELECT ESTIMATE.ESTIMATE_ID, ESTIMATE.CLAIM_NUMBER, CLAIM.CLAIM_NUMBER AS Claim FROM ESTIMATE INNER JOIN CLAIM ON ESTIMATE.CLAIM_NUMBER = CLAIM.CLAIM_NUMBER;
    The form field Limit To List is set to No. In the field, I need to be able to add a new number to the Claim table and also to the Estimate table (which it does, if it’s a new number), but if it’s a number that already exists in the Claim table, then I need the data added only to the Estimate table.



    I can’t have the extra step of having to first add the number to the Claim table before it can be used in the Estimate table.

    I hope this makes sense… It seems like this should be simple, but I’m so stuck on this. I don’t really know VBS, but really need the help. Thank you.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't understand.

    Is Claim table the parent and Estimate is related child? Then can't have record in Estimate without record in Claim.

    Can each claim have more than one estimate?

    Are you using form/subform arrangement? That is conventional approach for parent/child data entry.
    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
    danyd is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    23
    Thank you so much for responding. Yes, the Claim table is the parent and the Estimate table is the child.
    It's correct that I only want to have data in the Estimate table if it's also in the Claim table.
    It's correct that each claim can have more than one estimate.
    I just don't want to have to have a separate form to first enter the claim in the Claim table before it can be used in the Estimate table.
    It's not a form/subform arrangement. I just have the continuous form based on a query where the two tables are linked. I think you've already given me something to work with. I'll have to check it out tomorrow.
    Thank you again and I'll let you know tomorrow how it goes.

  4. #4
    danyd is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    23
    After posting my reply, I realized that the reason I didn't do a form/subform arrangement is because I want a continuous form.
    I think what's going on, is that my form is really a subform since I want to display/add/edit all the Estimate(the child) data and need to view it in continuous form. At the same time, if there's a new Claim_Number to add, then I would like it to automatically add to the Claim(the parent) table. Is there a way to do this?
    Thanks

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Main form bound to Claim. Subform bound to Estimate. Subform can be in Continuous view (or Single or Datasheet). The main form would be in Single view. There is a trick to allow both to be subforms and still related if that's what you want.
    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.

  6. #6
    danyd is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    23
    I eliminated the parent table - it really wasn't necessary. that solved the problem. Thank you so much, dany.

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

Similar Threads

  1. Duplicate data message for a data entry form
    By JulieMarie in forum Access
    Replies: 5
    Last Post: 07-30-2013, 08:18 AM
  2. Access ignoring format override
    By pdlecesne in forum Reports
    Replies: 4
    Last Post: 04-24-2013, 06:30 PM
  3. Replies: 4
    Last Post: 10-11-2012, 07:40 AM
  4. Validate Form Field based on Duplicate Data
    By bornfattom23 in forum Forms
    Replies: 3
    Last Post: 11-05-2010, 02:02 PM
  5. Entering duplicate data in Form
    By cotri in forum Forms
    Replies: 1
    Last Post: 01-06-2010, 11:45 PM

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