Results 1 to 13 of 13
  1. #1
    Join Date
    Nov 2004
    Posts
    90

    Unanswered: how to transfer data?

    hello,

    I have an existing two table which need the transfer from microsoft excell format. how to get that data either from excell to access or system access to excell?

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To export from Acce$$ to Excel use DoCmd.OutputTo acOutputTable,yourTableName,acFormatXLS, yourOutputFilename

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To import from Excel to Acce$$ use
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, yourTableName, yourExcelFileNamewithPath, True

    True means it has Field names in the first line

  4. #4
    Join Date
    Nov 2004
    Posts
    90
    hello,

    I have been follow the code given by hammbakka, thanks for that..but there something error with my table which error msg told 'variable not define'..any idea regarding that please tell me...

    this is my sample of code entered:

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, doc_pecah, "C:\Documents and Settings\SUPERVISOR\My Documents\abdullah\Excell\whse trf det.csv", True

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Does the first line contain data or the fields' names?

  6. #6
    Join Date
    Mar 2004
    Location
    Oakland, CA, USA
    Posts
    26
    Hello oasislah,

    Error: 'variable not define' because of doc_pecah. If it is your tablename then you need to enclose with double quote. Try below:

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "doc_pecah", "C:\Documents and Settings\SUPERVISOR\My Documents\abdullah\Excell\whse trf det.csv", True

  7. #7
    Join Date
    Nov 2004
    Posts
    90
    hello hammbakka,

    yes doc_pecah is my table where the data is wanna to transfer to. But the given code also occur run time error (external table is not in expected format). any ideas?

    one more question is how to make sure the data increase to 1 or plus one when user click on button. I have one table which contain record for increasing to one if user select that fieldname.how?

  8. #8
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    First of all you have to make like Mr. McCampbell told you, put the file name between qoutes

    The code I wrote it for exporting Excel files and not cvs ones. Then you have to convert this cvs to Xls one.

  9. #9
    Join Date
    Nov 2004
    Posts
    90
    this is sample code I have entered on click event:

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "doc_pecah", "C:\Documents and Settings\SUPERVISOR\My Documents\abdullah\Excell\whse trf det.xls", True

    this also cant find the file...

  10. #10
    Join Date
    Nov 2004
    Posts
    90
    hello,

    actually I have 2 table 'doc_pecah' and 'prod_pecah' which the data from excell will come in. But the data is come from one file of microsoft excell. how the data from that file will insert into this separate two table.I have create the button to transfer the data to the table. then the result is all the data will be view in listbox in form 'BQ update'. then user just select from that list box to move to the trans2 from.

    your help is fully appreciated.

  11. #11
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Quote Originally Posted by oasislah
    this is sample code I have entered on click event:

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "doc_pecah", "C:\Documents and Settings\SUPERVISOR\My Documents\abdullah\Excell\whse trf det.xls", True

    this also cant find the file...
    Ya 3abdullah:
    Try to name your file something simple like "c:\myData.xls" and put it on the root directory of the C:\ drive, to check whether he finds the file or not.
    Hope it could help

  12. #12
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Quote Originally Posted by oasislah
    this is sample code I have entered on click event:

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "doc_pecah", "C:\Documents and Settings\SUPERVISOR\My Documents\abdullah\Excell\whse trf det.xls", True
    this also cant find the file...
    Ya 3abdullah:
    Try to name your file something simple like "c:\myData.xls" and put it on the root directory of the C:\ drive, to check whether he finds the file or not.
    Hope it could help

  13. #13
    Join Date
    Nov 2004
    Posts
    90
    hello,

    anyone know how to create autonumber on the form/ report? please suggest..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •