Results 1 to 6 of 6
  1. #1
    senghlim is offline Novice
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    6

    Creating a form that creates a table and combines it with another

    hello,



    I have a large database full of sales information. Call this TotalSalesDB

    I want to make a form, where a sales manager will type in the sales they have accomplished for the day. This information is stored in a table, lets call this DaySalesTbl.

    The sales manager will enter all the information in the form that populates the table DaySalesTbl. After that I want a "submit button", which when pressed, will add all the data from DaySalesTbl to TotalSalesDB.

    Now when i mean 'add', i don't mean anything fancy, just literally put one table on top of another.

    Both DaySalesTbl and TotalSalesDB have the same number of fields with the same data types.

    for example

    if DaySalesTbl is:

    X | Y | Z
    ---------------
    1 | 2 | 4
    4 | 3 | 1


    and TotalSalesDB is:

    X | Y | Z
    ---------------
    9 | 8 | 8
    7 | 7 | 7
    6 | 6 | 6

    Then after the "submit" button is clicked and they are combined, TotalSalesDB should look like

    X | Y | Z
    ---------------
    9 | 8 | 8
    7 | 7 | 7
    6 | 6 | 6
    1 | 2 | 4
    4 | 3 | 1

    Any help would be greatly appreciated! this is for my internship in Citibank so yes, very appreciated

  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,518
    Not sure I like the design, but you can create an append query that does what you describe, and run that from your button.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    senghlim is offline Novice
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    6
    thanks managed to work it out. i don't like it either, but that's what is requested so i just do what i'm told...

    also, everytime i run an append or delete query i get 2 warning message boxes per action. do you know i get rid of these warning messages? it says that you can by "clicking the help button" but when i do it just directs me to the help homepage

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If you are using DoCmd.RunSQL you can switch to CurrentDb.Execute, which does not throw warnings (and is more efficient) or add a SetWarnings line before and after your RunSQL line.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    senghlim is offline Novice
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    6
    Thanks, but what is DoCmd.RunSQL and CurrentDb.Execute? I'm a bit of a newbie so i'm not too sure with these terms. any way you could step me through? Same goes to the SetWarnings line

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    How are you running the queries that throw the warnings?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 09-06-2010, 11:45 PM
  2. Replies: 1
    Last Post: 07-27-2010, 08:02 AM
  3. subform creates duplicate record
    By jheintz57 in forum Forms
    Replies: 0
    Last Post: 03-29-2010, 11:50 AM
  4. Open form which creates new record
    By mjhopler in forum Forms
    Replies: 7
    Last Post: 02-09-2010, 01:37 PM
  5. Form that runs query and creates reports
    By Valeda in forum Forms
    Replies: 2
    Last Post: 05-04-2006, 07:01 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