473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to have "Quantity" in a table keep adding every week.

I have been trying to work on this project but stumble across a few mistakes. Basically, I have a search form with 2 listboxes. When the user chooses both options and presses search, a table shows those specific entries searched for.

The problem: Now, every week a new table is inputed because of new data to the company. I need to know how I can have "Quanity" from previous weeks keep ADDING ON to the new weeks table. Is this possible?
Jun 8 '07 #1
10 1664
MSeda
159 Expert 100+
It would be best to append the new data to the existing table rather than create an new table every week. You can import the weekly batch table to a temporary table and then run an append query to add it to the main table.
Jun 9 '07 #2
That makes sense :) I am sort of new to access and learning as i go along. How would I go about doing so?
Jun 10 '07 #3
can anyone help me please?
Jun 11 '07 #4
MSeda
159 Expert 100+
Sorry for taking so long to get back.

what you want to do is have a master table that has the fields that appear in the spreadsheets you'll be importing weekly.
Then you will need to create an append query that appends the data from the temporary data you are importing to the master table.
Once you have this set up just have the user import the weekly table always saving to the temporary table and then run the query that appends the data to the master table.
to give more details on how on how you want the forms that perform the operation to look and function and where the data is imported from (excel, another database?)
Jun 11 '07 #5
Sorry for taking so long to get back.

what you want to do is have a master table that has the fields that appear in the spreadsheets you'll be importing weekly.
Then you will need to create an append query that appends the data from the temporary data you are importing to the master table.
Once you have this set up just have the user import the weekly table always saving to the temporary table and then run the query that appends the data to the master table.
to give more details on how on how you want the forms that perform the operation to look and function and where the data is imported from (excel, another database?)
the data is imported from an excel spreadsheet. so far i got the form to search for what is selected in both listboxes. here is my code:

SELECT SalesLic952.CSPC, SalesLic952.DESCRIPTION, SalesLic952.QTY, SalesLic952.NAME, LSList.CITY, LSList.ADDRESS, LSList.[PHONE NUMBER], LSList.[POSTAL CODE]
FROM LSList INNER JOIN SalesLic952 ON LSList.LIC_NO=SalesLic952.CUSTOMER
WHERE SalesLic952.CSPC=nz(forms!Form1!List1,"SalesLic952 .CSPC") And LSList.City=nz(forms!Form1!List2,"[LSList].[City]")
ORDER BY SalesLic952.CSPC, LSList.CITY;

Where in here do I add information about master and temporary tables?
I had a lot of help with this code. I am not really that familiar with it, but I do understand it and what they mean. Do you think you can type a sample code of what ur talking about above?
Jun 12 '07 #6
the data is imported from an excel spreadsheet. so far i got the form to search for what is selected in both listboxes. here is my code:

SELECT SalesLic952.CSPC, SalesLic952.DESCRIPTION, SalesLic952.QTY, SalesLic952.NAME, LSList.CITY, LSList.ADDRESS, LSList.[PHONE NUMBER], LSList.[POSTAL CODE]
FROM LSList INNER JOIN SalesLic952 ON LSList.LIC_NO=SalesLic952.CUSTOMER
WHERE SalesLic952.CSPC=nz(forms!Form1!List1,"SalesLic952 .CSPC") And LSList.City=nz(forms!Form1!List2,"[LSList].[City]")
ORDER BY SalesLic952.CSPC, LSList.CITY;

Where in here do I add information about master and temporary tables?
I had a lot of help with this code. I am not really that familiar with it, but I do understand it and what they mean. Do you think you can type a sample code of what ur talking about above?
basically, i just want to have the quantity in numbers changed to what this weeks sales volume is, without losing numbers that havent changed as well.
Jun 12 '07 #7
MSeda
159 Expert 100+
The searching of the data and the additions of weekly records are two separate issues, I am addressing the issue of importing the weekly additions, the query you have for your search form looks fine but is irrelevant to the issue of how to handle the importation of a weekly excel spreadsheet.
To handle the importation of the spreadsheet it is probably best to use a separate form designed specifically to assist the user in updating the DB with this weeks info.

You will need to design an append query to append the data from your weekly import table to the master table. just use the access query designer. select the weekly import table and when you change the query type to append it will ask what table you would like to append to, Choose the master table. append all of the feilds to the similar fields in the master table.
On the importing form you need to have a way for the user to decide which spreadsheet to import (unless the spreadsheet is always the same name and path). This can be as simple as a textbox where they type the file name or you could use something like a common dialog where they can browse for a file.
in addition to the selection control you also need a command button the on click event for your command button should look something like this (more or less)
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command5_Click()
  2. Dim mySheet As String
  3.  
  4. mySheet = ????? 'reference the control the user is to select the excel file in
  5.  
  6. 'Import The spread sheet to weekly import table when the table is imported it will overwrite the weekly import table with the new spreadsheet
  7. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "Weekly Import Table", mySheet, False
  8.  
  9. 'Run the query that appends the data to the master table
  10. DoCmd.OpenQuery "Add Weekly Data"
  11.  
  12. msgbox "Data Import Complete"
  13. End Sub
  14.  
once the data has been added to the master table (the one you want to query on the search form) then it will be available on the search form.
Jun 13 '07 #8
this works thank you. the only issue im having now is that the entries are not doubling up on each other. new entries in the table are being made and this is making duplicate store names. For example if Store#3 ordered 1 last week and 1 this week, the new imported table should state QTY:2. Instead it has Store #3 QTY:1, Store #3 QTY:1. How do i fix this to not show a duplicate?
Jun 13 '07 #9
The searching of the data and the additions of weekly records are two separate issues, I am addressing the issue of importing the weekly additions, the query you have for your search form looks fine but is irrelevant to the issue of how to handle the importation of a weekly excel spreadsheet.
To handle the importation of the spreadsheet it is probably best to use a separate form designed specifically to assist the user in updating the DB with this weeks info.

You will need to design an append query to append the data from your weekly import table to the master table. just use the access query designer. select the weekly import table and when you change the query type to append it will ask what table you would like to append to, Choose the master table. append all of the feilds to the similar fields in the master table.
On the importing form you need to have a way for the user to decide which spreadsheet to import (unless the spreadsheet is always the same name and path). This can be as simple as a textbox where they type the file name or you could use something like a common dialog where they can browse for a file.
in addition to the selection control you also need a command button the on click event for your command button should look something like this (more or less)
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command5_Click()
  2. Dim mySheet As String
  3.  
  4. mySheet = ????? 'reference the control the user is to select the excel file in
  5.  
  6. 'Import The spread sheet to weekly import table when the table is imported it will overwrite the weekly import table with the new spreadsheet
  7. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "Weekly Import Table", mySheet, False
  8.  
  9. 'Run the query that appends the data to the master table
  10. DoCmd.OpenQuery "Add Weekly Data"
  11.  
  12. msgbox "Data Import Complete"
  13. End Sub
  14.  
once the data has been added to the master table (the one you want to query on the search form) then it will be available on the search form.
mySheet = ????? 'reference the control the user is to select the excel file in

what does this mean? what do i put in the ?????
Jun 15 '07 #10
mySheet = ????? 'reference the control the user is to select the excel file in

what does this mean? what do i put in the ?????
does this overwrite the previous data? i need to add on to it without duplicating records.
Jun 20 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael J. Astrauskas | last post by:
I'm developing a fairly basic shopping cart. My original implementation had the user click on a link to add an item to the cart (addtocart.php?item=123456). I figured it could just increase the...
3
by: ChadDiesel | last post by:
Hello everyone. I need some advice on table structure for a new project I've been given. One of our customers sends us an Excel spreadsheet each week containing their order. Currently, someone...
13
by: Shannan Casteel via AccessMonster.com | last post by:
I set up two tables (one with the regular claim info and another with ClaimNumber, PartNumber, and QuantityReplaced). The ClaimNumber is an autonumber and the primary key in both tables. I made a...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
1
by: Des | last post by:
I have upgraded some software from classic ASP to .NET I am not using the .NET datagrid. Ihave a html table with a <type="text"> but on the submit to another page it is not readable. I have been...
7
by: PW | last post by:
Hi, I have a form with unbound fields on it. The user selects a record from a recordset and I populate the unbound fields. When I try to change the unbound quantity text box, Access 2003 tells...
2
by: dbruzzese84 | last post by:
I currently have a search button that calls 2 tables and shows me the information i want. One column of info is Quanity. I want to be able to search for information and have the quanity of certain...
6
by: maminx | last post by:
hello all, i have this html below <input type="text" name="items" size="3" value="1" onchange="javascript:showNameObject();"/> and i want to alert that object of name with this script ...
0
by: raylopez99 | last post by:
I ran afoul of this Compiler error CS1612 recently, when trying to modify a Point, which I had made have a property. It's pointless to do this (initially it will compile, but you'll run into...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.