Results 1 to 10 of 10
  1. #1
    tss is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    8

    double update query problem

    I am designing a database for a youth club. I have the tables - member details, outing details and attending outing.

    In the outing details, i have fields such as - cost of deposit and total cost of trip
    In the attending outing table i have fields such as - deposit paid (check box), amount paid, total paid, amount outstanding.


    I have also added another update to that same query. I making the deposit paid (check box) equal the cost of deposit. That figure will then be added to amount paid and will update the total paid field
    IIf([Attending Outing].[Deposit Paid]=True,[Outing Details].[Cost of Deposit]+[Attending Outing].[Amount Paid],[Attending Outing].[Amount Paid])
    It works fine but is rather slow..

    I have created an update query for amount outstanding.
    [Outing Details].[Total Cost of Outing]-[Attending Outing].[Total Paid]
    It works fine



    When i run them both in the same update query it updates the total paid field. Then i have to press run again to update the amount outstanding field.

    I only want to update that query once rather than update that same query twice.


    SQL -
    UPDATE [Outing Details] INNER JOIN ([Cadet Details] INNER JOIN [Attending Outing] ON [Cadet Details].[Member ID] = [Attending Outing].[Member ID]) ON [Outing Details].[Outing ID] = [Attending Outing].[Outing ID] SET [Attending Outing].[Total Paid] = IIf([Attending Outing].[Deposit Paid]=True,[Outing Details].[Cost of Deposit]+[Attending Outing].[Amount Paid],[Attending Outing].[Amount Paid]), [Attending Outing].[Amount Outstanding] = [Outing Details].[Total Cost of Outing]-[Attending Outing].[Total Paid];



    thanks in advance

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Can you show the table structures and relationships?

    Also, an Update query allows updating of one or more fields in a single table.

  3. #3
    tss is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    8
    Quote Originally Posted by orange View Post
    Can you show the table structures and relationships?

    Also, an Update query allows updating of one or more fields in a single table.
    Sure -

    Update query -
    http://i154.photobucket.com/albums/s270/Iceogon/5-1.png

    attending outing table -
    http://i154.photobucket.com/albums/s...eogon/1-10.png

    outing details table -
    http://i154.photobucket.com/albums/s270/Iceogon/2-2.png


    relationships -
    http://i154.photobucket.com/albums/s270/Iceogon/4.png

  4. #4
    tss is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    8
    any suggestions?

  5. #5
    tss is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    8
    Anyone?

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    The only suggestion I have is that you describe your proposed application in simple terms. Identify all the things (entities) involved and how they relate. Identify the business rules/facts that your application must support.
    Build a model of the "business" and create some test data so that you can test your model against the business facts.

    My feeling is that your question is quite detailed and readers are not familiar enough with your environment/business to comment effectively.

    There are some free existing data models here
    http://www.databaseanswers.org/data_models/index.htm

    There is a summary of RDBMS here
    http://forums.aspfree.com/attachment...achmentid=4712

    There are articles on database design here (the first 3 topics and the Hernandez Process are a great reference)
    http://www.rogersaccesslibrary.com/forum/topic238.html

  7. #7
    tss is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    8
    ok thanks anyway

  8. #8
    tss is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    8
    can this thread by deleted or archived please?

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I wasn't trying to turn you off, it was a real suggestion since you were not getting any responses. If you have solved the issue, great; but I hope you're not wanting to archive/delete the question because of the suggestion.

  10. #10
    tss is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    8
    Quote Originally Posted by orange View Post
    I wasn't trying to turn you off, it was a real suggestion since you were not getting any responses. If you have solved the issue, great; but I hope you're not wanting to archive/delete the question because of the suggestion.
    no no, i have taken a look at those sites.

    I think i will just use 2 queries as it works fine in 2 separate queries.

    I want the first post and the post with pictures to be edited so no info can be found - i can edit it so thats why i wanted it deleted

    thanks for your answer 'orange' and appreciate the help!

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

Similar Threads

  1. Update query size problem?
    By Akshay22 in forum Queries
    Replies: 1
    Last Post: 10-26-2011, 01:02 PM
  2. Update query problem
    By pratim09 in forum Queries
    Replies: 5
    Last Post: 05-05-2011, 06:05 AM
  3. Problem with Update Query?
    By emarchant in forum Access
    Replies: 7
    Last Post: 10-08-2010, 12:51 PM
  4. Append query double criteria
    By Gerry in forum Queries
    Replies: 0
    Last Post: 03-23-2010, 03:55 PM
  5. Update Query problem
    By sollem1 in forum Queries
    Replies: 0
    Last Post: 11-08-2007, 10:16 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