Transfer of database - URGENT help needed

A

Amateur

Dear Sirs
In c:\cps208\ I have serveral databases which are to open from the
Mainswitchboard DB with the Navigation Form situated as well in c:\cps208.
I created a shortcut from this Navigation Form to my Desktop.
With this shortcut I can navigate through my different DB’s.
With this Navigation Form I open a Form called Daily trading from the
trading DB.
On this Daily trading Form is a command button which is transferring data to
a table "webtotalbalancebie30p" in a database which is laying "C:\Documents
and Settings\Klaus Müller\Desktop\cps208web\transferdb.mdb"
I am using the following code:
Private Sub cmdTransfer_Click()

On Error GoTo Err_Handler

Dim strTargetDB As String
Dim strTargetTable As String
Dim strSQL As String

strTargetDB = "C:\Documents and Settings\Klaus
Müller\Desktop\cps208web\transferdb.mdb"
strTargetTable = "webtotalbalancebie30p"

With CurrentDb

strSQL = _
"DELETE FROM [" & strTargetTable & "] " & _
"IN '" & _
strTargetDB & "';"

.Execute strSQL, dbFailOnError

strSQL = _
"INSERT INTO [" & strTargetTable & _
"](accountnumber, initialinvestment, guaranteedequity,
monthstartingbalance, optionpl, SumOfcontractvalue, optioncommission,
commission, managementfeebasic, Incentivefeetotal, electronicfee, vat,
adjustment, netliquidationbalance, paidoptionpremium, optionvalue,
SumOfopenpl, SumOfinitialmargin, SumOfmaintenancemargin, opentradebalance) IN
'" & _
strTargetDB & _
"' SELECT webtotalbalancebie30p.accountnumber,
webtotalbalancebie30p.initialinvestment,
webtotalbalancebie30p.guaranteedequity,
webtotalbalancebie30p.monthstartingbalance, webtotalbalancebie30p.optionpl,
webtotalbalancebie30p.SumOfcontractvalue,
webtotalbalancebie30p.optioncommission, webtotalbalancebie30p.commission,
webtotalbalancebie30p.managementfeebasic,
webtotalbalancebie30p.incentivefeetotal, webtotalbalancebie30p.electronicfee,
webtotalbalancebie30p.vat, webtotalbalancebie30p.adjustment,
webtotalbalancebie30p.netliquidationbalance,
webtotalbalancebie30p.paidoptionpremium, webtotalbalancebie30p.optionvalue,
webtotalbalancebie30p.SumOfopenpl, webtotalbalancebie30p.SumOfinitialmargin,
webtotalbalancebie30p.SumOfmaintenancemargin,
webtotalbalancebie30p.opentradebalance " & _
"FROM webtotalbalancebie30p;"


CurrentDb.Execute strSQL, dbFailOnError

End With -------------------- IT CONTINUES HERE _______________________

If I run this code directly from the Form Daily trading from the Trading DB
everything is running perfect.
If I run this code, after opening the Daily trading Form from the Navigation
Form I get the error message 3078 MS Jet database engine cannot find the
input table "webtotalbalancebie30p".
What am I doing wrong? If I run the command directly it’s working – if I run
the command after opening the Form through another Form I get the error
message.
Can someone help?
Thanks
Klaus
 

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

Similar Threads


Top