Reference in Frontend to Backend table

G

Guest

I recently split my database to a front-end and back-end. On my front-end, I
have a button that I use to transfer a couple of text files to a table on the
front-end. I now need to edit the code to transfer the text file to the
back-end. How do I reference the backend table in my front-end form
DoCmd.TransferText VBA code if the backend is
G:\user\contracts\contracts_database_be.mdb and the table name is
tbl_Account_Master?


DoCmd.OpenQuery "Qry_Flush_tbl_Account_Master" 'remove existing
records from tbl_account_master

Acct_Master = "C:\AS400\account_Master.csv" 'assign variable to
existing account master csv file

DoCmd.TransferText acImportDelim, "Account_Master Import
Specification",
"G:user\contracts\Data_files\contracts_database_be.mdb!tbl_Account_Master",
Acct_Master, False 'Transfer csv. file using saved import specification to
tbl_Account_Master - THIS DOESN'T WORK

Thanks for your help.
 
G

Guest

Thank you,

I thought I had to change it.

But now I am getting a "Numeric field overflow" error which has never
happened before. . . I thought (I don't know why) it might be related to my
splitting the database.

What could be causing this problem? It worked before...
--
www.bardpv.com
Tempe, Arizona


Douglas J. Steele said:
It doesn't matter that you've split into a front-end and back-end. As long
as the linked table in the front-end is still named tbl_Account_Master, you
simply refer to that linked table:

DoCmd.TransferText acImportDelim, "Account_Master Import Specification",
"tbl_Account_Master", Acct_Master, False
 
G

Guest

I know where the problem is. There are some records in my text file that
have alpha and alpha numeric Account_no and tbl_Account_Master.Account_No is
a numeric field. When I remove these records, the transfer works perfectly.
However, I don't want to have manually remove these records every time
(before, Access just set to null and I had a query that deleted them as I
don't need these records). Why won't it just set to null now??
--
www.bardpv.com
Tempe, Arizona


Douglas J. Steele said:
It doesn't matter that you've split into a front-end and back-end. As long
as the linked table in the front-end is still named tbl_Account_Master, you
simply refer to that linked table:

DoCmd.TransferText acImportDelim, "Account_Master Import Specification",
"tbl_Account_Master", Acct_Master, False
 
D

Douglas J. Steele

Import to a temporary table, then use an Append query to take the valid data
from the temporary table and populate the actual table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Emma Aumack said:
I know where the problem is. There are some records in my text file that
have alpha and alpha numeric Account_no and tbl_Account_Master.Account_No
is
a numeric field. When I remove these records, the transfer works
perfectly.
However, I don't want to have manually remove these records every time
(before, Access just set to null and I had a query that deleted them as I
don't need these records). Why won't it just set to null now??
 

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