Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Using variable in transfer command (2003)

    I have a form that I use to enter date criteria for transferring data to Excel.
    I can hard code the file name in Excel but would prefer to use a variable. The variable depends on the month of year and shows correctly on the form. However, when I run the transfer command below:

    DoCmd.TransferSpreadsheet acExport, 8, txtPath, True, ""

    I get an error telling me that I have the wrong data type for one of the arguments.
    I declared the variable as a variant.

    Help! Please!

    Thanks,

    itconc

  2. #2
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Using variable in transfer command (2003)

    Sorry, but I think I forgot the part of the query I want to transfer.
    It should read:
    DoCmd.TransferSpreadsheet acExport, 8, "Monthly Report-Claims Detail", txtPath, True, ""
    Amazingly - it works!
    Sorry to bother you all!
    itconc

Posting Permissions

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