Copy Table With Prompt For New Name

Aug 13, 2007

Once at the beginning of each month I extract all new cases from last month into a table. The table has a generic name as I repeat this step monthly. I would like to save or archive the data each month without having to manually copy and paste the table and rename it, prior to the new extraction, so that I have a record of each month. The archived table will not be used in any queries or reports.

The table I want to copy and rename is named 'tblSampleFrame'

At the beginning of the month before I delete the contents of the 'tblSampleFrame' to pull the new data, I would like to copy the old table and include a date in the new name. How would I set up a button on a form to copy the file and prompt me for the new file name? The new name would be 'tblSampleFrame_mmyyyy' where I can specify which month and year.

View Replies


ADVERTISEMENT

General :: Copy Data From Local Access Table To Linked SQL Server Table?

Jan 13, 2014

I have an MS Access accdb with linked SQL Server 2012 ODBC tables. I am working on a procedure to copy data from local tables to these linked tables (identical schema). I did a simple

Code:

DoCmd.RunSQL "INSERT INTO linkedTable SELECT * FROM localTable"

This works, but is very slow. Way too slow. (INSERT copies the data one record at a time).

I would like to copy the data in a bulk operation, or operations that I can execute programmatically.

View 1 Replies View Related

Modules & VBA :: Copy Record To History Table And Then Delete It From Main Table

Jul 9, 2014

I have a form with a sub form. when a record is choosen in a combo box the sub form is filled out with a record.

what I am trying to do is have a button that will copy that record to a history table then delete it off the the main table.

I cheated by using the wizard to get the code to delete the record but I am having troubles modifying the code to copy that record to the history table. Here is the code below. I have tried to insert code in several places but it just errors out.

'------------------------------------------------------------
' Master_tbl_sub_fm
'
'------------------------------------------------------------
Function Master_tbl_sub_fm()
On Error GoTo Master_tbl_sub_fm_Err
With CodeContextObject
On Error Resume Next

[Code] ....

View 8 Replies View Related

Modules & VBA :: Copy Structure Of A Table To Make A Temp Table

Apr 20, 2015

I'm trying to copy the structure of a table to make a temp table. I'm using CopyObject (which also copies the data). So when I delete the data from the temp table, it also deletes data from the source table. Is the data linked? It should just be deleted from the temp table. Below is the beginning of the code. I've stepped through, and at the last step shown, the data in the source table deletes.

Code:
Dim strFile As String
Dim temp As String
Dim tbl As String
Dim db As DAO.Database

' error handle
On Error GoTo F_Error

[Code] .....

View 3 Replies View Related

Active Table And History Table, How To Copy On Deletion?

Feb 14, 2006

My 2nd post, and I am very new to DB and Access. I have a problem that I want to get help on. I want to set up a main form that is used to enter and delete all data for my table. I wish to add either a button or to make it automatically happen when a record is deleted, that it is first copied to a separate table with the same fields, except it also has a closed date that would be the date that the record was copied over. I know zilch about VB, VBA or any other language other than AutoIt, so assume I am what I am, an ignorant beginner.

I did look into the event somethihng like upondeletion or something... while trying to find help on this in the access and VBA parts of Office, but I do not know how to utilize the event with Basic or SQL, which I know none of either.

Any help or examples are very much appreciated.

**EDIT**
I do not require all fields to be recorded to the secondary DB (History), so if someone can just give me an example of how I would move two fields to a separate DB, I can hopefully learn enough from it to do more.

Thanks a Bunch!


EXAMPLE**
Current Loans (Table 1):
CustomerID
Name
Address
City
State
Phone

Customer History (Table 2):
CustomerID
Name
Phone

That gives an example to help understand what I need. I want to store the CustomerID, Name and Phone values of the record being deleted, to the History Table, which I am using as a closed account table for later look up.

View 14 Replies View Related

Automate Copy Table And Sequence Table Name

Oct 27, 2004

I have a user who wants to automate copying a table from our main database. Basically, he is naming the new table with the original table name and the current date. For example, Part_Table_9-3-04, Part_Table_9-4-04, Part_Table_9-5-04 etc for each day of the month.

He wants me to write a macro, module, or vb code that automates the steps.

I have DoCmd.CopyObject,"Table1",AcTable,"Table2" I want to concatenate the date function (now) or (today) with the new table name but can't seem to get this to work.

Any suggestions?

Thanks for helping,

Jeff

View 3 Replies View Related

How To Copy All Record On A Table To Another Existing Table?

Feb 3, 2005

I have a table with employees’ information. I want to copy all records in this table to another existing table “WorkTimes”. I do not want to edit my employee table, so therefore I want to copy all records to another table before editing/adding information in other fields. How I can do that with a macro or module?

Thanks in advance.

View 3 Replies View Related

How To Copy A Column From One Table And Insert It Into Another Table In The Same Db

Feb 3, 2006

How to copy a column from one table and insert it into another table in the same database

Hi, All,

I have two tables (old and new) sitting in the same database. The new table is the result of 'data cleansing' done by an external company. In the process (export and import via excel) two memo type colums in the table were truncated in excel.

To make the new table usable, I must therefore now copy/insert the two memo columns from the old table into the new table.

Both tables are already Access tables and sit in the same database. Both tables, of course, have the same number of rows.

I tried to high-light one column in the old table, clicked copy, then high-lighted a blank column in the target table, then clicked Paste, but got error msg: "This text is too long for this field. Try copying a shorter text", as if I had wanted to copy the whole column into one cell rather than one column into another column of equal length.

What is the best way to proceed?

Thanks for your help.

Adrian

View 4 Replies View Related

Copy Linked Table Into A Local Table

Jul 30, 2006

Well, heres the situation. I have a complicated query that refuses to work all the time using a linked table for the data (data is gathered from a FoxPro DB). If I copy the data into a local table in my database then the query will run fine.

The data needs to be updated only 1/month but I don't want to have to do it manually every month. I would like to use VBA to copy and paste the data from the linked table into my local table. Does anyone know of an efficient way to do this? I'm trying to avoid running a VBA loop and adding each record one-by-one (very slow).

View 2 Replies View Related

Copy Table Post And Secondary Table

Jun 26, 2007

I have a problem... I have four tables(but my problem is limited to just two)
The tables are Orders, Customers, Items and OrderedItems
The two more detailed below creates the problem when trying to copy an already existing order to a new since the customers usally order the samethings over and over again.

Orders
IDOrders
IDCustomers
strSalesperson
strWhen
strSent

OrderedItems
IDOrderedItems
IDOrders
IDItems
iNumber
bPacked

So I have made a copy button on the order form. The copy button should do this:
1. First save the old orders IDOrders and IDCustomers (which it does)
2. Create a new order with old data (which doesnt do)
3. Copy all post in OrderedItems with a new IDOrdered using INSERT INTO and using columns

My SQL statement is like follows:
sSQL ="INSERT INTO Orders(IDCustomers, strSalesperson, strWhen, strSent, strComment) VALUES (" & itmpIDCustomers & ",'" & strSalesperson & "', '" & strWhen & "','" & strSent & "');"
But the reply I got is "Could not find output table 'Orders'" but I have checked the names over and over again but it doesnt work.

View 1 Replies View Related

Copy Table Data To New Table Without One Record

Oct 24, 2005

hey guys,

how can i make a query to copy records from one table to the other, and leave out one record. the record has corrupted somewhere and is causing havoc on some forms.

cheers

View 4 Replies View Related

How To Copy Records To Different Table

Jun 22, 2006

Hi all

This gonna be a long one.... I've search the whole forum for answer to this problem, but couldn't find the one suitable enough.

I have a quote table with the following field:


QuoteName
QuoteDescription
QuotePrice

and booking Table:


BookingName
BookingDescription
BookingPrice

The real table is much more complex, but this will do for now.

When a client call up for a quote, their request will be added into the "QuoteTable". One name can occur many times depend on how many they ask for quote. Once they decided to proceed with the booking, all the records need to be transfered into "BookingTable".

Currently, I use either one of the following codes found in this forum:


Dim dbs As DAO.Database
Dim rstQuote, rstBooking As DAO.Recordset

Set dbs = CurrentDb
Set rstQuote = dbs.OpenRecordset("SELECT * FROM QuoteTable " & _
"WHERE QuoteName = ' " & Name & " ' ")
Set rstClient = dbs.OpenRecordset("BookingTable")

Do Until rstQuote.EOF
rstBooking.AddNew
For Each Field In rstQuote.Fields
rstBooking.Fields(Field.Name).Value = _
Nz(rstQuote.Fields(Field.Name).Value, "")
Next Field
rstQuote.MoveNext
rstBooking.Update
Loop


or


Dim lngOuterCounter, lngInnerCounter As Long
Dim dbs As DAO.Database
Dim rstQuote, rstBooking As DAO.Recordset

Set dbs = CurrentDb
Set rstQuote = dbs.OpenRecordset("SELECT * FROM QuoteTable " & _
"WHERE QuoteName = ' " & Name & " ' ")
Set rstClient = dbs.OpenRecordset("BookingTable")

If Not rstQuote.EOF And Not rstQuote.BOF Then
rstBooking.AddNew
For lngInnerCounter = 0 To rstQuote.Fields.Count - 1
rstBooking.Fields(lngInnerCounter) = _
Nz(rstQuote.Fields(lngInnerCounter), "")
Next lngInnerCounter
rstBooking.Update
End If


But none seem to work. Can anyone help?


Cheers
arnodys

View 8 Replies View Related

Copy Table On A Form

Oct 23, 2004

In the database I am developing, users have to be able to copy a table, no data, structure only. The source table is always the same one. Users have to be able to specify the name of the new table.
I would like to have them do this on a form, easy of use is important. Any ideas on this? Thanks. Trucktime

View 2 Replies View Related

Copy Record From 1 Table To Another

Aug 29, 2006

Hi Everyone

I wonder if anyone can help me with code that i can use to copy a single record from table1 to table2

that i can use in a subroutine.

Thanks in advance to anyone that may offer some help

Kindest regards

Tony

View 1 Replies View Related

Copy Result Into The Table

Sep 15, 2007

Hi all, how can I have the result which is shown as "DateEnd" on the form available on the table. right now if I open the table "tblShift" the fields are blank!
Thanks

View 3 Replies View Related

Copy Table From One Back-end To Another

Sep 22, 2005

I have a database that acts as a front end for two different back-end databases. What I want to do is be able to copy a table from back-end #1 into back-end #2.

My first stab was to try to do a TransferDatabase on the linked table from b-e #1, but that just put a link in b-e #2, and not the actual data.

Can this be done?

Thanks,
David

View 4 Replies View Related

Copy Data Into Another Table

Oct 5, 2006

Hi:
Can any one please help me when user select 2 dates from DDLDate1 10/09/2006 and DDLDate2 10/12/06 and the name and it close the form. I need to create multiple records in the another table on the basis of two dates like that.

Data in continous form table1
-----------------------------
Data entered in continous form
10/09/2006 10/12/2006 John
10/12/2006 10/13/2006 Petty
11/11/2006 11/11/2006 Stiffny

Required data into table table2
10/09/2006 10/09/06 John
10/10/06 10/10/06 John
10/11/06 10/11/06 John
10/12/06 10/12/06 John
10/13/06 10/13/06 John
10/12/2006 10/12/2006 Petty
10/13/2006 10/13/2006 Petty
11/11/2006 11/11/2006 Stiffny

I am currently using a continuous form where there are two drop downs one for AppDate and other for EndDate. I need a script here once use close the form, Script check the data and create multiple records on the basis of date selection into table2. I am using two tables. One for the continous form and the other for the reports (Both have same fields). Continous form table i empty it every time once it close. So i need the result into another table assume form table name is table1 and table where i need multiple records name is table2.

Thanks.

View 1 Replies View Related

Queries :: SQL Copy From One Table To Another?

Dec 9, 2013

I have created a table1, with 3 fields: A, B and C, with 500 rows.

I want to copy this data over to table2 starting at row 700.

What is the sql for this.

Additionally I would like to in the 4th column to write November in the same copy over of the 500 rows.

View 1 Replies View Related

Modules & VBA :: Copy Value To 2nd Table

Jun 18, 2014

I have a database with two tables, and a form that is bound to the 1st table. I have a duplicate record button on the form. One of the functions I want to happen is when the duplicate button is pressed, one value is copied from the form and added to the 2nd table. The tables are basically set up the same with an ID column which is the key and an autonumber, and the second value is a number. So I want to copy the number to the other table and add a record. What is the best method? Can I use an insert into and just copy from a variable, or is the better method with a recordset. Either way, I have not been able to figure this silly thing out and it is preventing me from moving forward with this database.

View 11 Replies View Related

Copy Fields To Another Table

Nov 12, 2014

What I need to do is copy some fields from one table to another after updating via a pop up form.

Explanation:

Form [frmWorkItem subform] and [frmReactiveWorkPoList] are located on a tab control (Tab110, pages 0 and page1) and are linked by [ClientID] to the main form [frmReactiveTracker]. The functionig of this set up works fine.

The process of entering data starts with [frmWorkItem subform], here i use a popup form to enter a new record and when the popup closes the new record is seen in [frmWorkItem subform]. Unfortunately there are five duplicate fields in table frmReactiveWorkPoList which can't be changed now (the result of bad normalisation and now too much work to change it).

The duplicated fields in the newly entered record in [frmWorkItem subform] need to be copied to the respective fields in frmReactiveWorkPoList either when the popup closes or some other more efficient method.

I have attached the sample stripped down database. To start open frmReactiveTracker and pick the third name from the drop down list.

View 11 Replies View Related

Loop / Copy From One Form/table To Another.

Dec 13, 2005

Please could someone enlighten me on the following scenario I have.

I would like to get from a button click the information from Sheet_subID (cat_parameter) copied into the Main sheet Description field. I think this maybe would be done with a loop? Taking one from in tunr from Sheet_subID and then putting it into the description filed until al cat_parameters have been copied.

This information is not beng duplicated as such because the text that lands in the description field will be modified slightly by the user. The information contained within the Sheet_subID are for presets for in the case below Compensator Setting 3. Compensator 1 would have different presets.

Any thoughts people?

Cheers

Ade

http://www.norwichlife.co.uk/loop.gif

View 7 Replies View Related

Copy From Table & Paste Problem

Mar 26, 2006

OK, here is a weird one, at least it seems weird to me. I have a field on a table, or query result, doesn't matter which, and it looks like this:"55264"25468"4562"123etc, etc.Now I need to copy that and paste it into the notepad in Windows. When I do that the pasted data looks like this:"""55264""""25468""""4562""""123"I have looked at it on the clipboard and it also looks like the above. I really need this data to paste to the notepad just like it is stored on the table (with one double quote only). It's one of those strange sounding things, please do not ask me to explain why...I just need it like that.Why the heck does the extra quote get added to the front and one get placed on the end?Test it yourself and see.Thanks

View 3 Replies View Related

Copy Data From One Field To Another In Same Table

Apr 27, 2005

I have a field called Shipdate. I have created a new field that is called invoicedate. What I want to do is copy all of the shipdates and paste them in the invoicedate field for my old records. From here on out they would be distinct fields but for old records and reporting purposes I need those dates.

Can I do that in a query, do I need a module???

It's probably easier than I think it is.

Thanks.

View 2 Replies View Related

Create A Copy Of Table Definitions

Nov 28, 2005

Hello,

Im a newbie at developing access databases. I have just finished creating my first application. The problem i have is that i would now like to create an exact copy of my table definitions without all the junk data i have been entering while i have been creating the application. I would like to use this copy so i can link the finished database to it. Could someone please offer me some advice as how to best go about doing this ?

Best regards,

Andy.

View 4 Replies View Related

Copy Autonumber To Another Field In Same Table

Jul 31, 2006

I need to make changes to a table already containing data. Currently the autonumber field is simply there as a primary key, but I now wish to use it for another number field (Accession No) which was previously completed manually.

As this doesn't seem possible or practical (as I need the flexibility to overwrite the number sometimes), I just want the autonumber to also appear in the Accesion No field when a new record is added (but be manually overwriteable).

I've had a play with default values and lookups, but with no success, and haven't found anything on the forum. Where am I going wrong, or is this just not possible?

Thanks for your help.
Alison.

View 1 Replies View Related

Copy Current Record To Different Table

Dec 4, 2006

Is it possible to copy the current record on a form to a different table?
Example:

Form Name = Training Orders bound to a table with the same name.
2nd Table Name = History

I need to export certin fields from the Training Orders Form into the History Table. Below is the way I am trying to make it happen, but it does not work.

With Me.RecordsetClone
.AddNew
![Forms]![History]![Last Name] = Me.[lastname]
.Update


Me.Bookmark = .LastModified




End With


End Sub

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved