Weird problem after splitting DB

crowegreg

Registered User.
Local time
Yesterday, 22:05
Joined
Feb 28, 2011
Messages
108
I've recently split a DB. I've attached two db's to show my problem.
First use TestDBGood
Within tbl Export New IPG Customers, their exists 44 new customers. These customers need to be inserted into individual tables based on the field "Acct Type".

Within form frm Import Data, here is what my code is suppose to do:
1. Create a recordset containing the customer data sorted by the "acct type" field
2. Read first record
3. Assign variables to all fields
4. Check to see if this acct type matches previous acct type. Initially the variable is set to null
5. With it being a new acct type, copies a table using a table template and assigns the table name to be associated with the acct type
6. Adds the record to the new table
7. Loop

As an example, if this code runs properly, this is what the results should be:
1. two tables named: IPG Cust - Other, IPG Cust - Retail
2. table Other contains 3 records, table Retail contains 41 records.

Now use TestDBBad
What happens is all records are within both newly created tables, and they are also within the template table.

Any suggestions would help!!
 

Attachments

I can't open your files because they're in .accdb format and I'm using A2003, but it doesn't much matter because I don't need to see your db to determine the most important question that I, or probably anyone else here, would ask before going any further.

That is, why in the world would you want to create a separate table for every account type?
 
These tables are exported, and then imported into an accounting package. The accounting package requires that each membertype be an individual import. That's why I need individual tables/files based on member types.
 
Can you export query results to an Excel file or delimited text file, or is it a requirement that you export the tables themselves?
 
Thanks for spending time on my problem. Yes, I needed to export a table because of the file specs that are needed on the import process. Comma separated with no delimiter.

I solved my problem last night. In my further research, the problem was being caused by my copyobject command. I don't understand completely, but since the table I was using as the template was a linked table, Access would retain some of the properties for the new table. The easiest solution was to remove the link for the template file, then import the template file into the front end DB. It works perfectly.

Again, thanks for your assistance!
 
Can you export query results to an Excel file or delimited text file, or is it a requirement that you export the tables themselves?

I don't see how a 3rd party app would know if the exported csv / xls is from a query or a table.

I agree, using query results on a single table would be far better if the import process allows it (and I don't see why it wouldn't).
 
With using a query, how do you specify the output file to not have quotes around each data field?
 
How do you handle the table export currently?
 
I just realized, I can use an export spec. So, a query could do the same thing. Thanks!
 

Users who are viewing this thread

Back
Top Bottom