"John W. Vinson" wrote:
> On Sun, 7 Sep 2008 00:50:06 -0700, Wahab <(E-Mail Removed)>
> wrote:
>
> >Hi
> >Pls. help me to convert my Excel sheet into access Table by writing
> >recordset. Sheet is some how like this:
> >Code Kwt Bhn Qtr
> >USD 0.268 0.377 3.643
> >BHD 0.710 1.000 9.654
> >DKK 0.053 0.073 0.717
> >I want to convert with access table (TblCurrency) in this way:
> >Country Code Rate
> >Kwt USD 0.268
> >Kwt BHD 0.710
> >Kwt DKK 0.053
> >Bhn USD 0.377
> >Bhn BHD 1.000
> >Bhn DKK 0.073
> >Qtr USD 3.643
> >Qtr BHD 9.654
> >Qtr DKK 0.717
> >please show me how i will write recordset to convert Excel sheet
> >thanks
> >
>
> No code is needed, or even appropriate. Instead you can use a "Normalizing
> Union Query".
>
> Use File... Get External Data... Link to link to your table (well, you can use
> code using the TransferSpreadsheet method if that's more convenient). Have
> your target tblCurrency already defined. Create a UNION query based on the
> linked spreadsheet:
>
> SELECT "Kwt" AS COuntry, [Code], [Kwt] AS RATE
> FROM linkedspreadsheet
> UNION ALL
> SELECT "Bhn", [Code], [BHN]
> FROM linkedspreadsheet
> UNION ALL
> SELECT "Qtr", [Code], [Qtr]
> FROM linkedspreadsheet;
>
> Add more select clauses if you have more countries.
>
> Base an Append query on this Union query and run it to append the data into
> your table.
> --
>
> John W. Vinson [MVP]
>
Thanks Mr.John
This will not solve my problem, sometime countries are increasing or
decreasing and I have more than 110 countries and currencies and want to
compare the monthly rate form past and current month and feed in system with
correct decimals, slight mistake in entry gives hell of difference. My idea
is to compare both tables and mark only fields which rates are changed, so I
can enter those rates only and minimise the entry mistakes.
For this reason I need to write code which will make my job automatically. I
appreciate if someone will give me how to write codes.
Thanks and regards
|