Hi,
This is my first venture to Access, and although my sql is average my vb is non existent, so pls bear with me....
I wanted to create a trading journal where i can record my trades by uploading them via the broker statement (csv) and then attach my screen prints. I have attached a copy of an demo file from the broker, so you can see the problems i have.
Having trawled the forums for the past 2 weeks and tried lots of different methods, i think i now have a good idea of what to do, but i just need a few pointers to get me over the line.
My plan is to load the file to a temp table first so that i can then import the relevant data to the correct table. (i only need one table at this stage)
I have managed to create a form that has buttons and events to load the temp table (DoCmd.Transfer Text).
Then I need to update my table from here and then delete the temp table (the delete i can do)
I was hoping to use DoCmd.RunSQL, but i found i couldn't use if statements, so this is where i am stuck.
It seems i might need more than one sql to update, as different transaction types mean different fields are populated.(i found if i didn't populate all fields it ignored those records).
So one sql for Interest transactions.
And one for trades.
Does that sound right?
Also with the trades, the trade details are in several rows in the csv, but need to populate one record in the table where they are joined by the TranLink field.
eg the ticket number in row7 = tranlink in rows 8/9/10/11.
I guess i can achieve this by referring to my temp table twice and joining ticket and tranlink?
so how to combine these two sql strings in vb so they run and order by the ticket number upon insert?
I tried to declare both my sql statements and writing an if statement, but that's when i got runtime 3129 errors.
thanks
Simon
This is my first venture to Access, and although my sql is average my vb is non existent, so pls bear with me....
I wanted to create a trading journal where i can record my trades by uploading them via the broker statement (csv) and then attach my screen prints. I have attached a copy of an demo file from the broker, so you can see the problems i have.
Having trawled the forums for the past 2 weeks and tried lots of different methods, i think i now have a good idea of what to do, but i just need a few pointers to get me over the line.
My plan is to load the file to a temp table first so that i can then import the relevant data to the correct table. (i only need one table at this stage)
I have managed to create a form that has buttons and events to load the temp table (DoCmd.Transfer Text).
Then I need to update my table from here and then delete the temp table (the delete i can do)
I was hoping to use DoCmd.RunSQL, but i found i couldn't use if statements, so this is where i am stuck.
It seems i might need more than one sql to update, as different transaction types mean different fields are populated.(i found if i didn't populate all fields it ignored those records).
So one sql for Interest transactions.
And one for trades.
Does that sound right?
Also with the trades, the trade details are in several rows in the csv, but need to populate one record in the table where they are joined by the TranLink field.
eg the ticket number in row7 = tranlink in rows 8/9/10/11.
I guess i can achieve this by referring to my temp table twice and joining ticket and tranlink?
so how to combine these two sql strings in vb so they run and order by the ticket number upon insert?
I tried to declare both my sql statements and writing an if statement, but that's when i got runtime 3129 errors.
thanks
Simon