Copying A Set Of Records Across Several Tables To Same Tables With A Few Changes
Apr 8, 2015
There is one main policy table, and a collection of related tables that store information associated with each of the policies (coverage amounts, agents, etc). What I'm struggling with though is where they renew every so often (most times it's each year, but some go three or more years). Because I need the database to show everything EXACTLY as it was on each policy term, even expired ones, I don't want to just edit the existing records when policies renew; I need to create a copy of the ENTIRE record (across all related tables), but with a new PK, and the ability for users to change a few items, such as the policy number and effective dates.
There are two keys that I use to identify policies: one is the PK, which is an auto# that will need to change, and the other is a small text ID set when the policy is first issued, in order to make sure that even when policy numbers change from year to year, we can always track the history, so of course that one will need to remain the same. If I have the user click a "Renew" button on the policy view form that goes to a small form that takes what changes I want to allow and converts those into variables, could I then use those variables in a query, and have it copy all of these related records, with the other tables taking the new PK from the main table to keep the overall policy record linked?
View Replies
ADVERTISEMENT
Dec 21, 2007
has anyone had a problem with copying tables from one database to another -- it used to be so easy by just dragging from one database to another but in 2007 this isnt possible -- it seems to want to delete records rather than copy over - am i missing a setting to allow this?
View 1 Replies
View Related
Dec 5, 2013
I have a field that has a description of the project I'm working on, which has client information on it. I want to take all 600 of those records and copy them to fields in the same table, so that I can remove the client information, which will allow me to pull whichever of those two I need when I run a query.
View 3 Replies
View Related
Dec 3, 2013
I am looking to copy one exceptionally large table to another. I can use VBA to copy the entire Report2013.accdb to Report.accdb while compacting at the same time. This is very fast and works well. However once it's copied I need to rename the table tblReport2013 to tblReport. None of these table are in the accdb that I am running the scripts from FrontEnd.accdb. I am working very hard to keep the data tables under the 2 GB limit, which is why linking and keeping the data separate is necessary. There is the chance that Report2013 will be on the network while tblReport will be local to the user, and may or may not be a subset of the Report2013.
I have considered a number of options:
DoCmd.Rename - I can't seem to tell it a database location
I could try
docmd.copyobject - and see if it keeps the file size the same or smaller then the original.
I could just write the sql statement and copy the data that way, and compact the table afterwards. The trouble with doing the transfer that way is hitting the 2GB limit, before I can compact/compress the newly imported data.It just seems odd to have to find another solution when all I really want to to rename a table and ensure the new new is still linked as a separate table.
View 1 Replies
View Related
May 28, 2013
I want to be able to copy the data within a selected field and then place it into a fresh database is this easily done?
my second questions is i have several fields which need to be merged into one 'Address' field as currently i have data with Building Name, Number, Line1, Line2, Line3, County, Town, Country. This is required to be merged into one field how would i do this?
Not all fields have data is there a way to put a space between each of the current fields when merged as well?
View 7 Replies
View Related
May 4, 2013
Query:
I have two tables : Table1,Table2.
Table1 has columns : A,B
Table2 has columns: A,C
What I want to do is to copy all data of "C" from Table2 to Table1 so that Table1 has columns: A,B,C..(Column "A" is common in both Tables).
View 4 Replies
View Related
Dec 9, 2012
I am using access 2007 and cannot seem to find in the field properties.I need to input data in one field in a table and it appears in a field within a different table.
View 2 Replies
View Related
May 1, 2014
I'm trying to create an access table (with a Primary key) that loads in the data from a Union SQL view.
Im hoping there is a way of achieving this? Ive tried an append and create table queries which copies the data but still no primary key.
I've created a blank table with the fields i want but cant think how to import the fields from the view into it?
Am i better off loading the view into excel?
View 2 Replies
View Related
Sep 8, 2011
I have a psychology project where we soon use a questionnaire on a daily basis (maybe 80 variables per day per subject). Currently, there is no data in the database.
I've managed to create a table called day1 (with 80 day1 variables) and a form that looks like the questionnaire we want to use (and linked apropriately to the variables in the table for day1).
What is an easy way of duplicating the table and form for successive days? That is, i want the structure of the day1 table copied to another table (call it day2). It has exactly the same variables except they are slightly different to differentiate them from day1. I would like the form for day2 to have exactly the same layout as the form for day1, but link to the variables in table 2.
I know i could just couple the day1 table, change the variable names slightly, and then copy the form for day1 and change the links to point to table2, but there are many assessments (18 days).
View 3 Replies
View Related
Jul 30, 2013
I have three tables. I want to combine all the records in these tables into one table. I need VBA code to do this. The first table is called down1, the second table is called down2 and the third table is called down3. All these tables contain the same fields so I don't think combining them will be a problem.
View 3 Replies
View Related
Dec 5, 2012
I have two tables "Master List" and "Audit". I want to delete the records from the "Master" that match those in the "Audit". I am using Access 2010 and have used it often but have built very few queries.
View 3 Replies
View Related
Sep 5, 2013
I'm trying to create a table for every record I have in a field. I have two tables, one titled "Experiments" and another titled "Students". I want the new tables generated from the field EXP_NAME from Experiments. I need it to have seven fields, one copied from Students, five labeled Trial1 thru Trial5, and a final for a grade.
View 10 Replies
View Related
Apr 25, 2014
My db includes two tables, Employees and Users, both with a pk of EmpNum (Autonumber in Employees; Number in Users). Users is a subset of Employees, and in the Users table, the row source for EmpNum is a query of the Employees table. I had a relationship defined with a one-to-one between the two tables, but did not have Enforce Referential Integrity or Cascade selected.
The problem is, I deleted a record out of Users, but it also automatically deleted the related Employees record. Re-creating the employee was quite the task because all related records in several other tables also disappeared. I experimented by deleting the relationship between the two tables and then deleting another user, but it still deleted the related employee. How can this be? The two tables are no longer linked, other than the Users EmpNum lookup.
View 6 Replies
View Related
May 7, 2014
I have been tasked with creating a simple database for work.
Basically the table tracks the progress of various employment checks. So example headings are Name, CRB, Occupational Health etc. Now basically, once all the checks are completed, I need the record to be moved to another table named 'Live'.
Is there any easy way to achieve this, or will i have to manually move each record once the checks have been completed.
View 3 Replies
View Related
Nov 21, 2014
I am working from an existing database which is just two table. The main table has a massive amount of redundancy and duplication and needs splitting into, at first glance, 5 tables.
After I have run my various make table queries and added a Primary Key and FK field to the new tables how do I populate the FK with the Parent PK.
I thought I could simply add all the fields from the new table and then create an adhoc join in an update query to populate the PK to the FK. When I do this however I get "You are about to update 0 records"
I have tried the table analyzer but it doesn't give the correct options to split the table the way I need.
View 6 Replies
View Related
Nov 21, 2012
I have a table (tbl Team Info) which contains names and codes for teams within my business (>400 records) and another table (tbl Process) which contains a list of high level tasks (30 records).
I need to create something where for each team name 9in tbl Team Info) I can map them to the tasks that they undertake (in tbl Process) and assign a percentage of time then spend on each task. Each team could map to several different tasks.
View 3 Replies
View Related
Sep 26, 2012
Currently trying to build a database for customer management and order placement/tracking. Want to set a couple of rules so that if I for instance click yes of billing and shipping address the same that the database will automatically fill the shipping address with the data I inputted for the billing address in the same table.
The other issue I can see I'll run into is, I want to be able to select one of the company ID's (made up of a three letter abbreviation of the full company name) in the product ordering table and it will automatically fill in the rest of the customer data (phone, email, address etc) data into that form.
View 2 Replies
View Related
Nov 6, 2006
Hi all!
I need a little help with a new function in our CRM db (Ac2000).
I've made a system for handling sale-prospects. When a sale is done, I want to transfer the costumer info to the costumer table. All this is well, no problems with this.
BUT, each prospect (And costumer) has contacts. There can be several contacts to each prospect, connected with a prospect number.
The challange is to transfer the contacts as well. And assigning the new costumernumber..
Dont bother going techincal right away, but a point in the right direction would be great!
View 7 Replies
View Related
Feb 16, 2005
I am trying to help a new employee with an MS Access 2000 problem. The db was created years ago, and the main table (permits) needed some major changes. She created a new db with a table that has all the same fields as the old db, but many new ones as well. We want to now import the data from the old db's "Permit" table to the new db's "Permit" table. All the field names are correct, but we keep getting errors trying to import and export. There are approximately 940 records.
Is there an easy way to do this? Thank you!
Mike
View 1 Replies
View Related
Jul 8, 2006
Hello. Can this be done?
I am creating a mini scheduling program, and I have one table that handles all requests (tblRequests), then a second table is the final schedule (tblFinalSchedule). On the table for the requests, I have a field called "locked" that is of type yes/no. The purpose of this field is for a meeting time that is of uptmost importance and that I don't want the program to manipulate it in any way.
Is there a way to program in VBA so that when a button on a separate form is clicked, those records that when the yes/no field is checked (set to true), are copied into the appropriate fields from tblRequests into tblFinalSchedule?
View 1 Replies
View Related
Apr 19, 2005
Is there a way that you can take information from multiple forms to create one record in a table?
View 1 Replies
View Related
Dec 26, 2012
Im having a problem with access 2010. I created a new database and created the relationships.However when i tried to create a form i noticed im not able to add any new records to my tables. Even if i don't use the form but directly on the tables the option for new record is greyed out.
View 5 Replies
View Related
Mar 20, 2013
I have a patients databasein which i have a patients table that is connected with 4 other tables via PID (one to many).I the have a form in which i select my patient, and i have 4 individual buttons for 4 other pop up forms to enter or edit the information based on which patient i select.The problem is that whenever i add a record i get an error that i have a record related in my main Patients table. I am attaching the file.mydb.zip The problem comes through my main form.
View 5 Replies
View Related
Sep 7, 2013
I'm using Access 2007.I have 2 tables that are identical in structure.The tables are called [Workorder Parts] and [Workorder Parts Temp]. They both have the same structure:
WorkOrderPartID (Autonumber)
WorkorderID(Number)
PartID(Number)
Quantity(Number)
UnitPrice(Currency)
Notes(Memo)
KitID(Number).
[Workorder Parts] has 128 records in in and [Workorder Parts Temp] has 28 records in it that are a small subset of [Workorder Parts] therefore, the contents of the key field column in [Workorder Parts Temp] is the same as in [Workorder Parts].I tried the following SQL but get an error message saying "Cannot Update "WorkOrderPartID" Field not updateable":
DoCmd.RunSQL "INSERT INTO [WorkOrder Parts] SELECT * FROM [Workorder Parts Temp]"
My aim is that I want all of the records from [Workorder Parts Temp]to be copied to [Workorder Parts] and have their "WorkOrderPartID" fields correctly updated with a new value...
View 14 Replies
View Related
Nov 22, 2005
hiya, im new to this sql scene..!
i have an MS Access db containing a few tables of 'calls recorded' and 'finished calls'.
(i want to move all 'Finished calls' to a seperate 'Finished Calls' table)
anyway, the thing i want to do is to move records from Table1 to Table2, i am able to do this using the following code...
SELECT * INTO Table2
FROM Table1
WHERE Finished='Yes';
this code does work, however it does not delete the records that were moved out of Table1 - they are still there, its more or less copying and pasting them..
any help would be much appreciated!
View 14 Replies
View Related
Nov 24, 2006
I have a database for tracking tasks. each task may have associated documents for it which are kept in a separate table.
I have an archiving procedure which takes closed or completed tasks (from the main table) and appends them to an archive table but it leaves the associated documents in the second table, or if I enforce integrity it will delete them.
Anyone have a suggestion on how i can archive records from two tables at the same time I include the archive code for your information....
Many Thanks as always for your help and assistance
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''
' procedure archives closed or complete records to archive table and then '
' Deletes original records from source table '
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''
On Error GoTo Err_btnArchiveAdhoc_Click
Dim strMySql As String, strResponse As String, intRecordCount As Integer
Dim cnn As ADODB.Connection
Dim rstTemp As ADODB.Recordset
strResponse = MsgBox("By clicking Yes you will Archive any closed or" & _
vbCrLf & "completed tasks and delete the original records from the table", vbExclamation + vbYesNo, gstrAppTitle)
If strResponse = vbNo Then
Exit Sub
Else
Set cnn = CurrentProject.Connection
Set rstTemp = New ADODB.Recordset
' builds sql string to append closed or complete records from the original table into archive table
strMySql = "INSERT INTO tblArchiveAdHocTasks ( Seq_Number, Item_Type, TaskTitle, Task_Description, TaskActions, StartDate, TgtDate, ReviewDate, TaskLead, Status, LastUpdatedBy, estHours, Progress, PersIDAssocPerson1, PersIDAssocPerson2, PersIDAssocPerson3, PersIDAssocPerson4, PersIDAssocPerson5 )"
strMySql = strMySql + " SELECT tblAdHocTask.Seq_Number, tblAdHocTask.Item_Type, tblAdHocTask.TaskTitle, tblAdHocTask.Task_Description, tblAdHocTask.TaskActions, tblAdHocTask.StartDate, tblAdHocTask.TgtDate, tblAdHocTask.ReviewDate, tblAdHocTask.TaskLead, tblAdHocTask.Status, tblAdHocTask.LastUpdatedBy, tblAdHocTask.estHours, tblAdHocTask.Progress, tblAdHocTask.PersIDAssocPerson1, tblAdHocTask.PersIDAssocPerson2, tblAdHocTask.PersIDAssocPerson3, tblAdHocTask.PersIDAssocPerson4, tblAdHocTask.PersIDAssocPerson5"
strMySql = strMySql + " FROM tblAdHocTask "
strMySql = strMySql + " WHERE (((tblAdHocTask.Status)=6 Or (tblAdHocTask.Status)=10))" ' status 6 is closed and 10 is complete
DoCmd.SetWarnings False
'DoCmd.RunSQL strMySql ' runs append query
rstTemp.CursorLocation = adUseClient
rstTemp.Open strMySql, cnn, adOpenDynamic, adLockOptimistic
DoCmd.SetWarnings True ' turn warnings back on
' deletes records that have been archived above
strMySql = "DELETE tblAdHocTask.Seq_Number, tblAdHocTask.Item_Type, tblAdHocTask.TaskTitle, tblAdHocTask.Task_Description, tblAdHocTask.TaskActions, tblAdHocTask.StartDate, tblAdHocTask.TgtDate, tblAdHocTask.ReviewDate, tblAdHocTask.TaskLead, tblAdHocTask.Status, tblAdHocTask.LastUpdatedBy, tblAdHocTask.estHours, tblAdHocTask.Progress, tblAdHocTask.PersIDAssocPerson1, tblAdHocTask.PersIDAssocPerson2, tblAdHocTask.PersIDAssocPerson3, tblAdHocTask.PersIDAssocPerson4, tblAdHocTask.PersIDAssocPerson5"
strMySql = strMySql + " FROM tblAdHocTask"
strMySql = strMySql + " WHERE (((tblAdHocTask.Status) = 6 Or (tblAdHocTask.Status) = 10))" ' status 6 is closed status 10 is complete
rstTemp.CursorLocation = adUseClient
rstTemp.Open strMySql, cnn, adOpenDynamic, adLockOptimistic
End If
MsgBox "Export Complete ", vbInformation, gstrAppTitle
Exit_btnArchiveAdhoc_Click:
Exit Sub
Err_btnArchiveAdhoc_Click:
If Err.Number = 2501 Then ' runtime error as user cancelled delete part of query
Exit Sub
End If
MsgBox "'Error" & Err.Number & "'" & vbCrLf & Err.Description
Resume Exit_btnArchiveAdhoc_Click
End Sub
View 6 Replies
View Related