Queries :: Inserting Missing Data In A Table
Jan 10, 2015
How to fix some records in my access table. It is a huge table more than 12k records!
In one of the field there are some data missing. The logic to reconstruct them is easy but I am not sure how to apply it in Access.
I have three columns one is the student ID, Year, term1 and term2
ID Year Term1 Term2
1234 2001 001 002
1234 2002 002 002
1234 2003 002 003
1234 2004
1234 2005 004 004
3311 2001 003 003
3311 2002 003 004
3311 2003
3311 2004 005 005
In the above example student 1234 has a missing record in year 2004 which supposed to be Term2 in the previous year (i.e. 003) and Term2 supposed to be Term1 value in the following year (i.e. 004). Similarly for student 3311
ID Year Term1 Term2
1234 2001 001 002
1234 2002 002 002
1234 2003 002 003
1234 2004 003 004
1234 2005 004 004
3311 2001 003 003
3311 2002 003 004
3311 2003 004 005
3311 2004 005 005
View Replies
ADVERTISEMENT
Feb 5, 2008
Hi!
I hope this is the right section for posting this Q.
I use Access 2003 on WinXP pro as front-end & for back-end a MySql on a Linux server. I use MyODBC to connect to the back-end and all the tables are on the back-end. The workstation is connected to the server via VPN (so the server and the station are on different locations).
Quite often I get a problem that not all records are inserted into a table. E.g. I have like 5 - 15 records (up to 10 fields) in one table and I want to transfer/copy them to another:
strSql = "INSERT INTO tblDetailNakup " & _
"SELECT tblDetailNakupTemp.* " & _
"FROM tblDetailNakupTemp;"
docmd.runsql strSql
most of the time it works OK, but from time to time a couple of records are missing.
What could be the problem? Is there any way for somekind of a check, if all has been inserted otherwise the query is repeated?
TNX in advance,
Miha
View 2 Replies
View Related
Nov 2, 2005
i have a problem adding the data from the fiels on the form into a table. I know you can just click on the navigation arrows and it will save the record but i want to use a submit button as this is more user-friendly and suitable for the work i'm doing.
I have attached the database... the form that needs the code for submit button is 'frmNew_JobStatus' and the table i'm trying to insert the data into is 'tblJobStatus'
can anybody have a look at what i've done so far and suggest how i can fix this... sample code would be very usefull as i'm not an access expert.
thank you all
View 1 Replies
View Related
Aug 25, 2004
I want to design a form , please note I have beginners information regarding Access,
I have 2 tables , 1 table has Project No, Document No, DEpt NO. with all the information
There is another table-2 with Project No, Document No. and Resourcrce. There is not data
in this table
What I want to do is , I want to create a form where in I select the Project No. and
Dept No. When I select these items the form should list me the data in Table 1 for that
Project no and DEpt No. , after this data is listed , I will add the REsource data
and all this data has to be stored in table-2. I hope some one will be able to guide me on
how to do this.
View 6 Replies
View Related
Nov 9, 2013
I am new to Access and i am designing a payroll system for my company. I have created a Table with
EMP Id, Name, Basic Pay, Total Working Days, Actual Work Days, Earned Salary, OT days, OT Hrs, OT Pay..
Now i have created a form with all the above fields.and calculated the earned salary from the control source where Earned Salary= Basic pay / Total Working Days*Actual Work Days and OT Pay =[Basic Pay/Total Work Days/8]*150%*OT Hrs.
Now my problem is i am not able to populate the fields in the table.
View 4 Replies
View Related
Mar 23, 2005
I am currently using access 97.
I am trying to read from an excel file that has the same format but changes data every day due to reports that I run from a different program. I just export them to this excel file called test.xls
What I want to do is import this data from the excel file and insert it into existing data in my table. I need to this every day.
Currently I cannot get the data to append. I can only insert the data once and cannot get it to append. I tried using macros, but think it would be better to use VB.
Any help you could provide would be great.
Thank You
View 1 Replies
View Related
Oct 22, 2007
I am new to access (using Access 2003) and am having trouble working with forms. Here's what I want my form to do:
-Use a combo box to select a specific system
-Given the selected system, pull up ID numbers and descriptions (in separate text boxes) from two separate tables corresponding to that one system
-Navigate through those ID numbers/descriptions from each table independently to find ones that match
-Store the ID numbers of the ones that match into another linking table
The biggest problem right now is being able to navigate through the different table ID numbers/descriptions and add both ID numbers to a row in a different table. I've tried using a combo box with the INSERT INTO statement into the code builder, but I keep getting syntax errors.
Does anyone have any suggestions on a better way to do this?
Thanks!
View 3 Replies
View Related
Jul 19, 2013
I currently have query that looks at 2 tables that hold financial information. I am querying the data to do some adding and subtracting based off a financial class of a facility. The issue I am having is that one table may have a financial code that the other does not have but I still need to show that financial class for the facility.
My looks as follows
FROM [CashValue Link] INNER JOIN TCashValue ON ([CashValue Link].FINANCIAL = [TCashValue].FINANCIAL) and ([CashValue Link].Date1 = TCashValue.Date1) AND ([CashValue Link].FACILITY = TCashValue.FACILITY) AND ([CashValue Link].CLT = TCashValue.CLT)
I am sure I am over looking something.
View 2 Replies
View Related
Sep 3, 2014
I have a master table that holds all of my data. The table details what qualifications someone is holding.I would like a query that would enable me to produce a list of people who DO NOT hold a qualification.
View 8 Replies
View Related
Jun 28, 2013
inserting values from a listbox in to a table. I have a table with a field named: PrefReports. This field will hold data from values in a list box that the user selects.
Table: Profiles
Field Name: PrefReports Type: Memo
The user utilizes a form to input the values necessary for the query. I then have the query tied to a command button. When the command button is clicked, the query is executed.
The query is as follows:
INSERT INTO TblProfiles ( [Employee ID], FName, LName, Barcode, PrefReports )
VALUES ([forms]![FrmCreateNewProfile]![txtEmployeeID], [forms]![FrmCreateNewProfile]![txtEmployeeFName], [forms]![FrmCreateNewProfile]![txtEmployeeLName], [forms]![FrmCreateNewProfile]![txtBarcode], [forms]![FrmCreateNewProfile]!lstReports.Value);
How can I take what the user selects in the list box, and insert into my TblProfiles.PrefReports field? When I run the query, all other information makes it to the table except the list box values.
View 3 Replies
View Related
Oct 31, 2014
In a Access 2003 database, I have an "Inscriptions" (subscription) database with a primary key on 2 fields idPersonnel (employee) and idSession. I have made a form so that user can select a session (in a listbox), then one or more employee (another listbox) and suscribe them to that session by using a button, which, on VBA side, first check that there is enough room on the session (defined by "MaxParticipants" field on "Sessions" table, linked to "Inscriptions" table on idSession), then insert data in "Inscriptions" table
This is working fine in a single-user environnement, but fails if 2 people want to join some employees on the same session at the same time, as I have a confirmation message between check and insertion. Therefore 2 users can select employees, get the confirmation message (at this point both are told there is enough room), resulting in having more people than expected joined to the session. Fortuneatly, if both users try to insert the same employee(s) to that table, one will get a duplicate error, but insertion will be made if employees are different.
On another DB engine, such as SQL server, I would use a stored procedure that would lock the table, do the check and the insertion then unlock the table.
But it does not seem to be possible in MS Access. What are the possibilities in MS Access to prevent a session from having more than maximum number of participants ?
View 1 Replies
View Related
Jun 4, 2014
I have 2 tables: one for repairs and the other for the billing for those repairs. There is a foreign key(record_num) in the billing table to match the primary key(prikey) in the repairs table. This works fine as long as the unit repair has been completed.
Now an employee wants to see records even if they are not completed and wants the rate to be $0.00 if the unit has not been completed. But by this method there is no record in the billing table.
My problem is if I have the 2 tables joined then I only see records that match both tables. Here is my SQL for the query:
SELECT DISTINCTROW tbl_module_repairs.end_user, tbl_module_repairs.pickup_date, tbl_module_repairs.complete_date, IIf([pickup_entity]="Storm","APS Storm","APS Field Tech") AS [Repair Pickup], tbl_module_repairs.mfg_part_num, tbl_module_repairs.manufacturer, tbl_module_repairs.module_type, tbl_module_repairs.incoming_module_sn,
[Code] ....
View 2 Replies
View Related
Sep 29, 2013
I have add my two tables
Main table calls Attack
Sub table calls Research
the main table attack is linked with sub table Research by Attack.ID and Research.attack_id from form automatically
The sub table Research have more than one record which is linked into the main table Example:
How can I get the data which is marked in blue into record 24 and the data marked in Red into row 23
using Unite_Equal column?
View 3 Replies
View Related
Nov 29, 2004
I have system that developed by using Ms Access which has been used for 2 years.
But last week, data in one of my table missing in the half way when user do the data entry.
There is header table and the details table in the form. All record of the header table were gone
but the details record was not problem.
Why all data in table were missing?
Please give some guidance.
Thanks
tee
View 1 Replies
View Related
Jul 28, 2014
I'm trying to make a sub form that displays the hours of an employee selected in a listbox. I've got most of it working but having a bit of an issue.
The info for thre query is in 3 tables:
tblStaff (name etc)
tblShifts (start and end times for days that this employee works)
tblDays (a list of days names so I can use numbers elsewhere)
My query looks like this:
Code:
SELECT tblDays.dayName, IIf(Nz([startTime],"")="","NWD",[startTime]) AS start, IIf(Nz([endTime],"")="","NWD",[endTime]) AS [end], tblStaff.staffName
FROM tblDays LEFT JOIN (tblStaff RIGHT JOIN tblShifts ON tblStaff.staffPK = tblShifts.staffFK) ON tblDays.dayPK = tblShifts.workingDay
WHERE (((tblStaff.staffName)=[Forms]![frmMain]![lst_myTeam] Or (tblStaff.staffName) Is Null));
This worked fine with a single user and some test data - it correctly displayed all days of the week, with start/end times on Mon and Tues where I had entered shift information, and "NWD" against all other days.
However, when I add a couple more employees to the mix it shows the correct info for the first employee, but anybody else it will only display days where person 1 doesn't have any hours. I haven't entered any hours for the new employees, but the query should still display Mon-Sun with NWD in every column. It shows Wed-Sun but Mon and Tues are missing.
I've tried different join types but they all come back with "ambiguous joins" error when I try to run.
View 4 Replies
View Related
Mar 7, 2015
I have a form, has some fields, one of them is the current date, so when the user click (save )button , which make (add new record )to the only table I have the problem that .all fields are inserted in the table , except the current date !! it is a text box ( Now() )!!
View 1 Replies
View Related
Jul 16, 2015
I'm trying to insert 10% of a dataset from dbo_billing into another table Random_Temp. Another form is open when this query is to be ran that passess in the billyear and billmonth... I'm sure it's a syntax issue as I can isolate the random number part and it displays the appropriate data, I just can't re-write it to insert into the other table:
INSERT INTO Random_Temp ( indx, peopleId, audited )
SELECT TOP 10 PERCENT b.indx, b.peopleId, b.audited
FROM dbo_Billing AS b
WHERE (((b.billYear)=[Forms]![billing]![billyear]) AND ((b.billMonth)=[Forms]![billing]![billmonth]) AND ((b.recertifying)=-1))
ORDER BY Rnd(-(1000*b.indx)*Time());
View 2 Replies
View Related
Jun 13, 2005
I have two tables
table1 his a master list of companies that I have already delt with
table2 is a list of companies that I have delt with as well as new companies and I allow for multiple instances of company data to be in table2
table2 my have several records refering to "ABCD Inc" but table1 will only have it once
If new companies show up in table2 how can I get a mass copy of all the companies that are in table2 but not in table1 into table1?
thanks,
honor
View 1 Replies
View Related
Jun 27, 2012
I have all my data sitting on a server in SQL. Within Access, I have linked tables pointing at SQL tables. I display the data on an Access form. Somewhere in their it is dropped a few records. This system is used for in and out processing and occasionally misses a few individuals. Could this have anything to do with the method in opening the table, ie dbopenTable vs dbOpenSnapshot.
View 1 Replies
View Related
May 13, 2013
I am getting method of data member not found for the following code when inserting values to a table. Form has three frames. Add/Insert is on OnClick Event.
MsgBox "First Value, " & Me.txt_FSNo
CurrentDb.Execute "INSERT INTO BackchargeLog (BC_FSNo, BC_FContract, BC_FPurchaseOrder, BC_FProjectArea, " & _
" BC_FTitle, BC_FDetailDescription, BC_FSupplierToBeCharged, BC_FSupToBeChargedNumber, BC_FSTBCContactName, BC_FSTBCContactNumber, " & _
" BC_FSTBCContactEmail, BC_FIncidentReportedDate, BC_FInitiatedDate, BC_FEstimateAvailable,
[Code] .....
View 7 Replies
View Related
Jul 9, 2013
I have created query and all my values come into the table from the query fine.
When i then go and generate the report all of the boxes are there for the data but there is no data in them. For owner and Job Id all info is there but job name, Department and a few others there is no data in the boxes.
View 3 Replies
View Related
Oct 8, 2013
I am using an Access 2010 DB to keep track of a schedule. Essentially, at least one person needs to be signed up to work for every hour of every day in a week.
Tables:
Days with 7 records
Hours with 24 records
Workers with as many people that sign up to work the different hours
Schedule signifying the worker, day, and hour which are signed up.
As of now i have a query that relates these results and gives me a line detailing the worker/time information for the slots that are signed up for.What I'm TRYING to do is to create a query that gives me BLANK worker info when there is no one signed up for a particular hour.Currently my Schedule table has the following:
WorkerID | DayID | HourID
----------+---------+--------
1 | 5 | 12
4 | 5 | 13
16 | 5 | 15
What I'm looking to do is have this table matched up with another table (or query) that provides every combination of day/hour. When an day/hour combination is skipped, the query will be able to "fill in the blank" with a row. Like this:
WorkerID | DayID | HourID
----------+---------+--------
1 | 5 | 12
4 | 5 | 13
| | 14
16 | 5 | 15
View 2 Replies
View Related
Apr 3, 2013
Client has asked me to create a report showing summary of monthly sales by day. That was easy. I created a query for the month the user selected and then summarized and group the data by day. Client like the result but would like to see zeros on the report for non sales days. Non sales days are days like holidays and there are no sales.
I am thinking of creating an table with 31 days of zero values and then join the two tables in a query? Or, should I create a temporary table with code and then merge the two tables which the existing query which I can then use for the report?
View 4 Replies
View Related
Apr 12, 2006
I've searched all over and can't seem to figure out an answer to this, so I'm putting it in front of the experts (who'll probably have a simple answer in about 10 seconds).
I'm doing a survey that has both radio buttons and check boxes. If it were all radio, it'd be easy, but the check boxes are making it complicated for me.
Here's the insertion code I'm working with:
Code:SurveyInsert2 = "INSERT INTO data (answerID, surveyID) VALUES ('" & Request.Form(fld) & "', '" & currentsurvey & "')"oSurveyAdd.open SurveyInsert2, "dsn=survey" For Each fld in Request.FormoSurveyAdd.Execute(SurveyInsert2) Next
which is spewing the answer:
Code:Request object error 'ASP 0102 : 80004005'Expecting string input/survey_process.asp, line 44The function expects a string as input.
Help! What am I doing wrong?
View 11 Replies
View Related
Nov 7, 2006
Hi, this dilemma really has me in a bind - say I have table1 and table2, when I enter data/update table1, I need to also enter the same data into table2. I know this sounds royally weird, but if there is a way to do this I would appreciate any and all help asap!
Thanks in advance.
View 3 Replies
View Related
Dec 8, 2005
Hi
I have recently had to add a new field to a FIRM table in our contact database, Firm.PhoneNumber (please don't ask why it wasn't there before!). The primary key in this table is Firm.FirmID.
I have a list available to me in .csv format that contains all the phone numbers I need, it has two 'columns', labelled FirmID and PhoneNumber.
The process is surely a simple one, I just need to update/copy/insert the corresponding phone numbers from the csv file into the Firm.PhoneNumber field. I won't bore you with what I've attempted thus far but could someone please provide me with the quickest possbile method for achieving this task?
Many thanks
Stuck21
View 1 Replies
View Related