TransferDatabase trouble

Tom72Bus

New member
Local time
Today, 03:58
Joined
Jan 22, 2009
Messages
9
Hi,

I'm currently trying to transfer a query from on database (this contains the daily bank transactions so changes on a daily basis ), to a table within a seperate database so that I have a list of historical data.

I'm currently using this code;

DoCmd.TransferDatabase acExport, "Microsoft Access", treasuryreportpath, acQuery, "standard_feeder", "Tbl_BankStatement"

The results this gives is a query, within the directory 'treasuryreportpath' with the name of "Tbl_BankStatement". Can I alter this so it imports the query data into a table - with the end result being a table which is continually being updated with the bank statement data?

Many Thanks

Tom
 
change acquery to acTable
assuming "standard_feeder" is a query
that should work
 
Thanks for getting back to me Vonnie,

I made the above amendment, unfortunatly this then throws up the error that it can't locate the query ''standard_feeder''? but it can locate it with a acQuery as object type.

the error message is as follows;

''run time error '3011'

The microsoft Jet database engine could not find the object 'standard_feeder'. Make sure the object exists and that you spell it's name and path name correctly''

The below code runs prior to the one i'm trying to iron out - and it picks up the query "standard_feeder" fine?

DoCmd.TransferText acExportDelim, , "standard_feeder", interfacepath & "banknet" & Format(Date, "ddmmyy") & ".csv"
 
Interesting, this works for me and sends out a table:
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\temp\export.accdb", acTable, "qrytest", "tblexport"

What is the value of treasuryreportpath ?
 
Hi Vonnie,

The treasuryreportpath was the link to which "Tbl_BankStatement" was in.

I realised I must have switched acexport to acimport late last night while I was trying a few different things :confused: forgot to switch it back :rolleyes: I changed this back and your suggestion worked a treat.

I eventually changed the query from a select to an append query and used docmd.Openquery and docmd.close acQuery to append the data to the table as I found the docmd transfer data didn't allow me to keep on adding data.

Many thanks for your help! I'm very much learning as I'm going along with this!

Tom
 

Users who are viewing this thread

Back
Top Bottom