Trouble setting up import actions - Help!

  • Thread starter Slez via AccessMonster.com
  • Start date
S

Slez via AccessMonster.com

I posted the question below in the Queries group but have not yet received
any feedback. I'm trying to import data from another database via an append
query. It seems this is the logical method, but having never done this, I am
starting out struggling a bit. Please read my previous post. Feedback is
greatly appreciated!!

- Previous post -
I have never used an append query, but need to import multiple fields across
4 tables from another database. Based on some previous postings, I have
determined that I will create a macro to first link tables using the
TransferDatabase action, then run an Append Query to pull gather the desired
data and add it to the destination tables, then run the DeleteObject Action
to eliminate the links. All of the properties of the destination tables
match the source database as they are required to.

Because I have never created an append query, I tried to create the query
with just 2 fields. In design view, I added the linked table, which renamed
itself from "Project" in the source database to "qryImport1" in the
destination database. From that I selected 2 fields: JobNumber and
ProjectName. The field names are the same in both databases. When I
selected Append Query and the Append To box popped up, I selected my
destination table which is called "tblProject".

So down below in the design grid I show the following 2 fields:

Field: JobNumber
Table: qryImport1
Sort:
Append To: JobNumber
Criteria: "065812" (This is the JobNumber that I want the recordset for. I
will be referencing a control on a form eventually.)

Field: ProjectName
Table: qryImport1
Sort:
Append To: ProjectName
Criteria:

When I view the query in datasheet view or run it, the JobNumber data reads
065812 as it should, but I get "tblProjectProjectName" as the data in the
ProjectName field.

What might I be doing wrong?
Thanks in advance for any help!
 
J

John Nurick

Switch the query into SQL view and copy the SQL statement, then paste it
into your reply to this.
 
S

Slez via AccessMonster.com

Thanks for the reply! Here is the SQL

INSERT INTO tblProject ( JobNumber, ProjectName )
SELECT qryImport1.JobNumber, qryImport1.ProjectName
FROM qryImport1
WHERE (((qryImport1.JobNumber)="065812"));

Slez

John said:
Switch the query into SQL view and copy the SQL statement, then paste it
into your reply to this.
I posted the question below in the Queries group but have not yet received
any feedback. I'm trying to import data from another database via an append
[quoted text clipped - 40 lines]
What might I be doing wrong?
Thanks in advance for any help!
 
J

John Nurick

I can't see anything in that SQL statement that might cause problems. Next
thing is to look at qryImport1. That's a strange name to give a table: are
you sure it isn't a query?

If it *is* a query, post back with its SQL - or try linking it again.

If it really is a linked table, open it in datasheet view and compare it
with the source table in the other database. Are there any differences?


Slez via AccessMonster.com said:
Thanks for the reply! Here is the SQL

INSERT INTO tblProject ( JobNumber, ProjectName )
SELECT qryImport1.JobNumber, qryImport1.ProjectName
FROM qryImport1
WHERE (((qryImport1.JobNumber)="065812"));

Slez

John said:
Switch the query into SQL view and copy the SQL statement, then paste it
into your reply to this.
I posted the question below in the Queries group but have not yet
received
any feedback. I'm trying to import data from another database via an
append
[quoted text clipped - 40 lines]
What might I be doing wrong?
Thanks in advance for any help!
 
S

Slez via AccessMonster.com

The qryImport1 came from the Destination argument(?) in a macro. I think
that may be causing this problem. I'm going to start from scratch with the
link/import and see how it goes. You may see more posts next week.
Thanks for your help!

John said:
I can't see anything in that SQL statement that might cause problems. Next
thing is to look at qryImport1. That's a strange name to give a table: are
you sure it isn't a query?

If it *is* a query, post back with its SQL - or try linking it again.

If it really is a linked table, open it in datasheet view and compare it
with the source table in the other database. Are there any differences?
Thanks for the reply! Here is the SQL
[quoted text clipped - 20 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top