|
-
trying to create a for to auto enter data from linked table
my database1.zip
here i have attached a ms access database, this is not the full verson but the forms and etc i had problems with are there. what i have is a frm called IG main in this frm is subforms based off different tbls. while working with this database i run in to an issue, i am using a sofware that auto puts data into a mdb file which is the only linked tbl in the database but it will only put it by date and will auto update as it the program runs. i have no idea how to change the program to send differnt data to the mdb, but in the frm IG main there is a page called Sq ft reading with in that page is a form i built off the linked tbl. the linked tbl only had a few fields Date, m²,Quantity,m/l, and ID. i added all of the rest. in the subform i made a code in the onload [total sq ft] = [m²]*10.7639104 so when u load the frm it converts m² to sq ft. the problem i run into is that the program only sends the data to the mdb in one record meaning if machine is running 12 hours it counts the m² as it runs it. what i want is when i click the hour number 1,2 etc it will take the total sq ft and subtract giving the next hour its sq ft. sorry hard to explaine with out viewing the database thanks email [email protected]
-
From your posting this your requirement.
- Each hour the linked table is updated with new values Date, m²,Quantity,m/l, and ID.
- You need to calculate the changes for m²,Quantity, and m/l since the previous update e.g last hour.
- Calculate the total sq ft based on the change in m².
Question
In your table Tabella1 you have one record for each day. is this a typical entry for one day? Please supply some sample data.
Tables
You will need three tables
1. Your current linked table
2. A temporary table to store the current hour download.
3. A History table to store the hourly downloads
Process required
1. Delete the data in the temporary table e.g. tbl_temp_data
2. Each hour store the current output from the linked table into a table e.g. tbl_temp_data
3. Using code to do the following
(a) lookup the current values in the history table for the previous hour these will be used as the previous values in the calculation.
(b) from step 2 we know the current values for m²,Quantity, and m/l
(c) to calculate the output for the current hour for m²,Quantity, and m/l subtract the values in (c) from values in (b)
(d) Calculate your square feet by multiplying (c) by your ratio
10.7639104
(e) add these fields etc. as record to the history table.
Allan
-
hi Mr. Allen i am not sure where you are trying to take me but it does sound good, i do not want to change any feilds in the Tabella1 sense thats the linked table that the program sends information to and do not want the program to get confused on where to send the informaion so i deleted all the feilds that i added to the Tabella1 the only feilds thats in the Tabella1 is Date, m², Quantity, and m/l i dont need to use m/l and the program does not send the inforation to the table every hour i just added a hour with a drop down list to select the hour in which it was pulled so really i am going to update the form to show what i am wanting i will then create a table called IG test 1 which will have all the feilds and on the form IG main and i will create examples the only feilds i want to man put in is the hour i want the form etc to put the rest of the information in for me but for this ex i will place the informaion in i did create a module and code to copy the last record but ex 7am-8am hour 1 375 sq ft 8am-9am hour 2 350 sq ft the program will only have the total in m² also how can i contact you for help thanks a lot i will send another post in a few with the update thank you again
-
Under the form IG main I liked using dates so when u open the form and add record it will put in the main date under production date then you see the page 1 is production Entry. Page 2 is Sq ft Reading when you open the Sq ft Reading page here I used the record source tbl IG Test 1 the hour number will be put in by the operator (person) the act. Units and m² to come from the linked table Tabella1 I want the units per hr to calculate each time the click hour number it will subtract from the act. Units also the sq ft per hr to do the same as well so it would have to sum the previous records of m² and act. And subtract from the current record of m² and act units then convert the m² to sq ft which is defined as m² * 10.7639104 also here is my email address i am trying to get this done by the first of the year thank you if you could send me a email so that i can send you the file via email due to file six maxes out more then 100kb with the examples and changes that i have made to the .mdb file thank you again
-
Please read your gmail as I have sent you my email address as requested by you to this address [email protected]
Have you Compact and Repair the database, this will may make it smaller in size?
Last edited by Allan Murphy; 12-22-2008 at 01:24 AM.
Reason: Compact and Repair
Allan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|