How to Transfer data from one subform to another?

I populate the fields of one subform by using a combo box, these fields contain product details.

Once this data has been obtained i want it to be added to another subform, this is an order subform ready for the products to be ordered.

i want to do this by using a button, therefore when a user selects the prducts they want they select the 'add to order' button to add the selection to their order form.

My attempt at this button so far is as follows...

Private Sub AddtoOrder_Click()
On Error GoTo Err_AddtoOrder_Click
Dim sql_string As String
sql_string = "INSERT INTO F_Order_line_subform (ProductID,Category,Description,Price) SELECT '" & _
Me.Recordset.Fields("ProductID").Value & "','" & Me.Recordset.Fields("Category").Value & "','" & _
Me.Recordset.Fields("Description").Value & "','" & Me.Recordset.Fields("Price").Value & "'"
Call DoCmd.RunSQL(sql_string)

    Exit Sub
    MsgBox Err.Description
    Resume Exit_AddtoOrder_Click
End Sub

As you can see i am trying to select the fields in my product catalogue and insert them into my order form(F_Order_line_subform).

The error i am getting is that.

'Could not find output table F_Order_line_subform'.

Why is this? It isnt a table in anycase so i dont understand why its saying it is. Is there another way to acheive what i want.

Thanks in advance!

Post your answer or comment

comments powered by Disqus
Hey guys, need a little help here.
I?ve been stuck on this problem for a while.
I would like to find out how to transfer data that?s on one form to another blank form.

If you can send the example code via email to me I would be thankful.
Email =

Hi everyone,

I'm a newbie and I'd like to know how to pass data from one form to an other?
I have similar information in 2 forms and I'd like to have the same information imported from FORM 1 to FORM 2.

Please help.


I'm using MS Access to connect to two external databases. I need to programmatically pull data from one database and copy it to the other, without copying it to local MS Access tables first.

My first effort involved (manually) creating links to the tables in the source and target databases, then programmatically creating an ADO connection to CurrentProject.Connection, and executing "INSERT INTO TABLE_B SELECT * FROM TABLE_A" against the new connection. This worked, but relies on creating linked tables.

Is there a way to do it without linked tables, i.e. just with ADO?

I was wondering if any one can help me find a way to transfer data from excel to Access.
I have a CSV file which is opened by Excel.I do not know how to start.


I have created my tables, forms etc.. all sorted and working. Thanks to the people who helped me on here.

Now all I need to do is transfer stored data from a seperate database into my new one.

I have imported the table of data I require, but now I need to get it into my table.


My table has different fields than the one I need to get data from, however I am not after everything, only generic data such as First Name, Last Name, Date of Birth, Address, Post code, telephone number.

Some fields in my table dont match the fields in the other table, which is a problem I feel.

What can be done to get data from one table to another, when table fields are sometimes different or are not relevant?


I am having trouble copying data from one subform to another (Access 2000). Here's the setup:

The subform frmPurchaseSubform has a field called SerialNumber.

The subform frmSale Subform has fields Transfer Name and Transfer Serial Number.

After I enter data in Transfer Name, I need the SerialNumber from the first subform copied to Transfer Serial Number on the second.

Here's the code I'm using:
Private Sub Transfer_Name_AfterUpdate()
Me.Transfer_Serial_Number = Forms![frmPurchaseSubform]![SerialNumber]
End Sub

When I run this I get the following error message:
Run time error '2450':
Microsoft Access can't find the form 'frmPurchaseSubform' referred to in a macro expression or Visual Basic Code.

I've had 2 other people check my spelling, the form names are identical.

Any help would be appreciated.

[This message has been edited by fmm (edited 03-21-2001).]

[This message has been edited by fmm (edited 03-21-2001).]

While writing some query i got struck

What is the requirement
How can I copy Data from one table to another?
Table1 has about 500 rows and 25 columns(col1, col2 ....col25). I want to copy selected columns from Table1 to table 2.
i.e. I wanna copy Col1, col2, col3, col5, col6, col7, col24, col5 from table1 to table2 in the same database.

I have never copied data from one table to another. I tried lot of R&D but none of them didn't work.

Can somebody tell me what query to use in this case.
This is kind of URGENT for me

Please Help
Thanks in adnavce



Can somebody show me how to display data's from one form to another.

What I would like to do is when a user clicks a button he will be brought to a 2nd form and in that 2nd form are information (not all) from the 1st form. The 1st form is in a tab page and the 2nd is just a form on its own with master and child link.

Thanks in advance.

I need to copy data from one set of tables (source) to another (destination). In the destination tables, some of the tables have less fields than the source tables (eg. Table2 (has Field1 and Field2) will be copied to Table1 (has only Field 1)). All of the fields in the destination tables are in the respective source tables.

I'd like to use this SQL to do the job for each pair of tables:


, but I get an error complaining that there's nowhere for Field2 to go. Is there a way to have the SQL copy over the data only where the two tables have fields in common without explictly naming the fields? I would rather not have to code something like:

INSERT INTO table1 (field1, field2) SELECT field1, field2 FROM table2....

because some of these tables have 25 fields, and I don't want to have to type each one.

Thank you,

Steve Geller


I have to transfer data from one table [all details] into three different ones [personal details], [specific details], [general details] and have two problems.

The first problem is that the information extracted from [all details] and inserted into [personal details] is given a unique id when inserted and i need to retrieve this id to be included in both of the other tables. Unfortunately there is no other way of identifiying an entry uniquely other than this ID, so the only way i can think to do this is as follows -

SELECT (Last.[unique id]) FROM [personal details]

My second problem involves the unique id again, in that if a record is deleted the database will never use the unique id associated with it again. Can i get it to do so?

Up until now i have been trying to solve the first problem by using VBA and SQL but am facing problem after problem. Am i trying to be to complicated, is there an easier way that i am overlooking?

Thanks Muzza


i'm having a problem with setting up a query that only needs to show data from one table that's not in the other one. I'll explain a little:

I have 2 tables (i've got more but this are the ones i need for this query) called tblUsr and tblGameUsr
In tblUsr i have 2 column called 'Id' (auto-nmbr) and 'Name' (txt)
In tblGameUsr i have 3 column called 'id' (auto-nmbr), 'Game_id' (numric) and 'Usr_Id' (numric)
'Usr-Id' is connected with the field 'id' in the table TblUsr
'Game-id' is connected to antoher table with gamedata
Now on my form i need to have a combobox with all the names from tblUsr but without the names that are already in the current game (tblGameUsr)
How can i exclude this users with a query?


Is there a way to get a form to take data from one table, and insert it into a new table without requiring user intervention?

The scenario:

One table set up as POP for purchase orders. Very often we ship out an entire shipment to just one customer, so i would like to add a button to the purchase order screen to convert this to a sales order. So, although i have a separate SOP table for manually inputting orders, i would like, on button click on the POP screen for it to open a new sales order form, inputting all the stock details from the POP screen automatically. I can see how to do this with an update query, but would like to be able to automate this via the form live to the record it's generating.

Hi I am working on How to import data from xml to excel sheet using macros,
i am using MS2003, i wrote below code for it

Sub ImportXMLtoList()
Dim strTargetFile As String
Application.DisplayAlerts = False
strTargetFile = "C:BookData.xml"
Workbooks.OpenXML Filename:=strTargetFile, LoadOption:=xlXmlLoadImportToList
Application.DisplayAlerts = True
End Sub
But when i run the a pop saying "The specified XML Source Doesnt refer to a schema.Excel will create schema based on the XML source data" is displayed, when i click ok button then Nothing is pasted in Excel.

Please help in this

HI All

Can anyone tell me how to transfer data from one or a number of fields in a form to other fields in the form.



How to transfer data form the customer fields into the delivery address, but also being able to adjust the delivery address when necessary.

Also how do you transfer a selection of data from one form onto a new/old form.

Hope you can help

Many Thanks

Dave Evans

Hi, How can I copy data from a subform in one form to another subform in another form using code?

Here I have a form called "Customers" which have a subform called "Unpaid Orders" which display the customer's unpaid orders. Both the form and subform is created from seperate tables. What I want to do is create a button in each record in "Unpaid Orders" so that when I click it a new record is opened in "Orders" form with the data in the "Unpaid Orders" fields copied to the fields in "Orders Subform".

Please help...

I have two databases for the running of a ATV shop, the stock lists and the sold items. Each Database contains the following fields.

Stock info:

Ledger refrence
Stock No
Frame no
Cost Price
Hire income
Actual cost (=[Cost Price] + [Repairs]-[Hire Income])
Estimated Sale Price
Balance (=[Estimated Sale Price]-[Repairs]-[Cost Price]+[Hire Income])

Sold Items:
Ledger refrence
Stock No
Frame no
Cost Price
Balance (=[Sold Price]-[Repairs]-[Cost Price])
Sold Price

I need a button that Is the bikes sold button that would transfer all data from one database and paste into another some fields do not exist in the Sold items database therefors should not be added. There is also some extra fields with data that needs to be added(Month Sold Price). How can I do this?

Thanks for your help


I was wondering if there was a way to automatically transfer data from one table into another. Specifically, if I have two tables, one called Students and one Alumni, is there a way I can click a button or something to transfer a student's data file from the Students' table into the Alumni table? Without having to delete the student's file from Student and retyping it all into Alumni?

Also, is there a way to, for instance, type individual monetary amounts into a single entry in a table and have the total automatically summed? Like, if I have a table for Donors, and every time one person makes a donation, add that one donation to their personal information and have another field that gives the total amount of all of their donations?


My db is currently set up like this:
tblMemberDetails - contains personal info
tblAddresses - holds company address details/phone/email and home address details/phone/email

We now want to restructure our membership to include corporate membership, i.e. one company may have several employes who could be members. This creates a one-to-many relationship, so I have created a new table via a make table qry and transferred company info. The company email address, however, is unique to the individual and I need to transfer this from tblAddresses (displayed in a subform) to tblMemberDetails (displayed in a form). How do I do this, so that it will also allow me to enter new records as new members come in?

Thanks in anticipation

Hey guys, need a little help here.

I?ve been stuck on this problem for a while.
I would like to find out how to transfer data that?s on one form to another blank form.

If you can send the example code via email to me I would be thankful.
Email =

I have a query question. I have a Table named tblAllParts1. I want to update this table from another
imported table named tblReqdParts. There are two fields in both tables:


My issue is how can I get the data from tblReqdParts1 into tblAllParts1 via a query. The two field names
Required1 and Required are different. If I do a make table the field names will not be correct for
tblAllParts1, this table is in another query and since it gets deleted and recreated the other query loses
the link.

Hi all,

Wondering if anyone can help here? I am currently working on a form that needs to display data from 3 unique queries - a crosstab query and two standard queries (one has line by line data and another summary data) that do not have a common link.

What is the best way to do this? Would it be possible to display the results of each of these queries in a single form by creating 2 subforms from 2 of the queries and placing them in the form of the 3rd?

Any suggestions on how to combine the data from the 3 queries into the 1 form would be much appreciated!!!

Thanks in advance.



Can anyone help me on transferring data from one hard disk to another hard disk?

Question: I have a table that contains a list of public records that I use for the purpose of mail merge campaigns. When a person replies to my marketing piece, I want to be able to a) transfer that information into a new table, b) delete the record from the original table and c) add additional information to the record via an interview with a form I set up for a phone questionaire. For me, the easiest point to do is (C) which would be to have a separate table for call ins for the additional information from the questionaire form. But how do I transfer the record from the one table to the other and how do I delete the record. Mind you, I want this to be automated tasks.

The reason for my thinking is that 1) I do not want to continue sending them marketing pieces if they called me already and 2) After a period of time, these records are going to be purged from my table anyway and I don't want my call ins or clients to be deleted altogether when step 2 is performed. Keep in mind that my business is foreclosure work and these records do have a shelf life. That's why they get purged over time

Thanks for the help

hi.. friends...

I m access user... i have made some queries.. & want to transfer data from different queries to on excel file in different sheets.. I have tried transfersheet macro... but... it transfers with one inverted coma in text column.. due to this the data exported to excel is no use to me.. as i m not able to upload the same to another application or even apply vlook in excel which is my basic purpose for doing this entire thing....

Can any body help me in this...

Not finding an answer? Try a Google search.