Hey guys- I have a 'Master Table' that holds all my imported records. After a few queries and whatnot- I need to break it down into specialized tables. For example- my Sales Associate info goes into one table (all their contact info, employee code, etc)- while the product info goes into another table.
As I import daily orders and whatnot- it also brings in the sales associates info. So, I want to have Access check the existing SalesEmployee Table for any existing records (by their employee code)- and if it doesn't exist, append it into the table. HOWEVER- if they are already showing in the SalesEmployee Table, I want it to check to see if their contact info is the same- if not, update it with the new info I am importing.
How do I go about doing this? Is this an update query all by itself? Or, do I need a more complex if/then statements and whatnot? Thanks!
I have two tables each with an ID field (autonumber/PK/No Dup etc).
I want to append two fields from one table to the other table. I have set up an Append Query to do this but it won't work - I get the following error - "The INSERT INTO statement contains the following unknown field: 'FiID'...."
I have a table that is filled based on selections that a user makes in combo boxes on a form. I am having trouble trying to figure out the best way to prevent duplicates from being inserted in the table when I do the append query part.
Since the table is filled based on the various selections the user makes I dont have a primary key or unique field.
Can someone help me figure out the best way to do this append/update queries to prevent duplicates. Also if you have a strategy for setting up some sort of unique or primary key for fields that could all be the same yet in the table only 1 record will show, no duplicates.
Just wondering if someone can point me in the right direction so that i can solve my problem?
Basically what i have is a select query that carries out some calculations based on data entered. These calculations are expressions as i am sure you guys know. what i want to do is put the value from the expression/calculation into my table in the correct fields made for these values. However i have tried everything i can think of to get this data into the tables fields but to no avail.
example. Expr1: [field1]*[field2] the answer created by [Expr1] is the value i want to be placed in [field3]
I was wondering if someone could help? I am using Access 2002 and I am struggling to find out out how you can insert/update/delete records through a form using the design view. Is this possible or do you need to do this another way?
Could some one point me in the direction of a comprehensive tutorial or outline some instructions for what I need to do?
I need to create a form that inserts people's details into a table
When user types in a surname as a parameter query, up pops the form with the details of the person stored in the database, and the user can update the details through the form and the details are saved to the table they came from.
This is a very simple problem most likely for the masses, but I am new to access. I have employees who enter will enter information about specific tests on electronics components into separate tables by a form. I know my method is poor, but this is how it works. I got assigned this database at my internship this summer because they ran out of thigns for me to do.....I've never even used access before, so as long as it works, they're happy. I have a form which which writes to a first table with 20 fields. I then have separate update queries which take the data in the first table and put it in all the other tables. Trust me, i know this is pretty much the opposite of the whole point of a relational database, but I am and was limited by time, for the size of the database they want, there was no time to learn about normalization etc etc. Sorry this is wordy, but THE QUESTION is......if they run multiple tests wtih the same information for some of the fields I have fields named "Run#, Unit#, Date" etc, even if there is records wtih the same information, hwo do i get it all to show. Right now, it seems to be rewriting over the same records. If they run 3 tests on unit 10 on August 1st, how do i get it so all those show up. I think its somethign wtih in the table, for the primary keys, changing the Index: No, Yes(Duplicates) Yes(No Duplicates) but I could be way off. Thanks, if the question doesnt make sense i'll try to rephrase it, I apologize I'm running on about 45 min of sleep:confused:
I am accessing an oracle database that has several thousand records in it. I am quering for specific requirements, but would like to save my query results in a local access database for faster searching capabilities. Is there a way for me to set up a query that will go out to my oracle table files, select the records that pertain to my search criteria, and add records to locally stored tables without duplicating itself each time that I run the query? I would appreciate any assistance in this matter. Thanks for your help!
I am using a DB to, among other things, calculate the monthly salary of my service users. Obviously, I have to do it every moth. Most of the data from the previous month will be the same in the next month, except date. Even if some of it is different, having the previous data on sight calculate the new salaries.
Every month I have to select all records with the month date (say 07/2015) I want to copy and
(1) copy paste the records into the salaries table, and (2) search and replace the new records' dates.
For example, records with 07/2015 with say 08/2015 (I have to replace downwards to ensure I don't change the record of the month I need to keep).
It can't be that difficult, but I have tried append and update queries to make this automatically (say by clicking a button) but so far no luck.
I'm hoping someone might be able to help point in the right direction. Our IT department applied a patch update to windows 2000 overnight, which has had an impact on the Append queries in my DB.
Basically I have a number of append queries that use lookup tables to append the appropriate data from the underlaying table to the required table. They all have a relationship of "only include rows where the join fields from both tables are equal".
These were all working fine yesterday, but this morning, even though there is data in the underlaying table that meets the criteria, not data is being identified.
Has anyone any idea, as our IT department don't know and are not prepared to undo the patch update.
In access Im working with two tables, this is my setup
tableA.documentnr tableA.revison
tableB.documentnr tableB.revision
Both tables are filled with data, Table B contains the same kind of data as table A, But tableA has documentnumbers with different revisions (for example revision a,b,c, for each revision a seperate row). Table B might have an identical document, but just one revision (like revision a).
Now I like to append the data of tableA to tableB, except if a revision is similiar to a revision in table A. (There is more metadata involved, but I will do it step by step)
Im not working with primarykey data, becayse in the end result table B will also have multiple (identical)document numbers with different revisions on different rows.
I tried to use the update query but it doenst append the documentnumbers where the revision is not present in table B I attached a image of the tables.
My problem is I need to know if the execution of the SQL statement was successful or not. I use the RecordsAffected method, but it always returns 0, no matter what.
I am giving two tables and I need to create a macro that automatically updates these tables depending on the value of a Yes/No field. If it's No, it's in the 1st table TableOne, if it's Yes it automatically updates to TableTwo.
So, the best way I saw to go about is to set up an append query and then create a macro that runs it
So my tables have the values FirstName, LastName and isValid (more but keeping it short)
So for my append query, I put TableTwo in the pop up I get. Then, where it asks for the field I put it
I do this for all (it was autocompleted except the Criteria field). I tried to keep Criteria with data only for isValid but that didn't work. I wrote it for all the field names, still didn't work. Whenever I click run it says it'll append 0 rows.
how can i appnend table from one table to other table when i do it says...Cannot Open Database". It May not be a database that your application recognizes , or the file may be corrupt.
So I am pulling data from a SQL data base into access and appending it to certain tables. To do this I have 15ish append queries. Is there a way to have them run in a certain order with one command?
I am trying to open a form with some records taken from one table, then alter couple of data in it and after that most importantly to append current records into a different table. The reason I need to append is that I need to keep track on every occurrence on same fields.
I tried to append one record to the end of the table (as end-of-the file indicator) but it's appending multiple records. Here is the code I have used to,
Table Name : MyTable
DoCmd.RunSQL "INSERT INTO MyTable (eof-Indicator) SELECT 'eof-101'
I have a sub table that acts as a revision history for the items in my main table. I've just finished uploading all the records into the main table and now I want to insert one record into the subtable for each record in the main table to start the history with the record creation.
The sub table looks like this:
tblRevisions - RevID (auto Number / primary Key) - RevDate (date of revision) - RevName (Who made the revision) - RevDesc (What revision was made) - RevAuthorized (Who authorized the revision) - RevLabel (Foreign key to the primary table)
The info I want to insert is:
RevID - Auto Number RevDate - 11/27/2013 RevName - 3 RevDesc - "Added Label to database" RevAuthorized - 1 RevLabel - (One for each record ID in tblLabels)
I suspect that I want to start with an insert into statement, something along the lines of:
Code:
Insert into tblRevisions (Revdate, RevName, RevDesc, RevAuthorized, RevLabel) Values ("11/27/2013",3,"Added label to database", 1, ?)
I'm not sure how to indicate that there should be one label for each Record in tblLabels or that revLabel value should match the ID from tblLabels though.
I'm tracking the holiday entitlement of a team of people. I use a query to work out how much unbooked holiday they have to take.
My problem is where I'm scheduling next year my query returns the names of those who have booked a holiday and their remaining entitelement. That's as it should be. However if someone hasn't yet booked any holidays then it simply doesn't display their record. I would like it to treat that record as zero and show the remaining entitlement as a full years entitlement.
Here's the SQL SELECT Employees.Trainer_Name, Sum([2015 Holiday].[2015 Days]) AS [SumOf2015 Days], Employees.Holiday_Days, [Employees]![Holiday_Days]-[SumOf2015 Days] AS 2015 FROM [2015 Holiday] INNER JOIN Employees ON [2015 Holiday].Trainer_Name = Employees.Trainer_Name GROUP BY Employees.Trainer_Name, Employees.Holiday_Days;
The problem here is that the Sum of 2015 holiday is Null
I have a query run that gives me a list of records that I view on a continuos form. What I want is to press a button and run a macro/Append Query to add a Single Summary record to another table.
For example my query spits out this data
Part # Quantity Serial Number GO2 1 123 GO2 2 456 GO2 2 789
What I'm looking to get is
Part Number Total Quantity Serial Number 1 Serial Number 2 .. GO2 5 123 456
I'm stuck on a couple of things.
1. Getting a new single row to append. 2. Getting Serial Numbers from several records to save on to a single record.
I need to insert(append) first and last line in xml file...
So I have xml file and I need to insert one line to the top and at the of the text... Xml file contains Cyrillic characters and method to recreate xml file is going wrong with characters conversions... The last line a can append easy but the first line is a problem...
I'm relatively new to MS Access (using MS Access 2013 but the db should work on 2010, too) and try to develop a database for an NGO I'm working in. [...].
However now I start to create forms and later reports for the actual user. The database will store information about clients and track consultations and assistance the NGO gives to them. There will be around 50.000 to 70.000 clients in the main table. Every client has a specific Individual ID and is member of a family which itself has another specific Group ID.
So now, I am almost done with forms (at least I want to believe that). But I ran into an issue I would love to have your comment and different approach on:
The Database I create is projected on another, significantly bigger database! The one I create is a kinda light version for other field offices with only the information they need to have, and additional tables for them to gather their own data and track their own activities. This being said, the light database needs to be updated every month once by the big (mother version). Both DBs cannot be connected!!!
So we will send to the field offices altogether 5 tables in one mdb-file every month. These 5 tables exist with the same structure ( name, field data-types, etc.) in the light version.
I now want to make an automatic update option (by pressing a key and select the "update-file"), i.e. based on the the respective Primary Key of every table the entry in the smaller DB should be updated!
Update for me means the following three things (Assume big DB is A, small DB is B):
1) If Primary Key (PK) exists in both tables of A and B, update the rest of the fields in B belonging to that key based on the specific record of A
2) If PK does not exist in A but in B, delete record from the database B (case: record was deleted in A after last update)
3) If PK does not exist in B but in A, add the record to database B (case: record was added to database A after last update)
I would like to show you what I already found in the internet on solving task 1) but I cannot post links due to my status.
Both links basically describe how to update one table by another in importing or linking the update-source table in the current DB, create a query with both tables, link the PKs of both and then using the Update To Criteria [UpdateSourceTable].[Field] for each field that I want to update.
But I wanted to ask before I implemented that if I should make a complete different approach since I also have 2) and 3) as tasks....