Results 1 to 9 of 9
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help on merge, cannot see what's wrong (2000)

    Me again [img]/forums/images/smilies/smile.gif[/img]

    Can someone please help I cannot see for the life of me where I am going wrong. The merge uses the current id on screen to post the data to a qry called qryVLetterExport which then saves it as a text file called Vletter.txt. However I put VLetter.txt i the Letters dir and it keeps deleting it and then coplaining that it is not here. The same vba code works fine on other buttons so obviously made a big boo boo somewhere.

    Attached is DB.
    Best Regards,

    Luke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    You must export qryVLetterExport manually for once, and create an export specification. Use the name of this specification in the DoCmd.TransferText instruction.

  3. #3
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    Sorry being dim here, please can you explain further?

    Luke
    Best Regards,

    Luke

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    Select qryVLetterExport in the database window.
    Select File | Export...
    Select Text Files in Save as Type.
    Click Export.
    Select Delimited, then click Next.
    Select the delimiter, and set other preferences if you like, then click Next.
    Click Advanced...
    Click Save As... and specify a name (or accept the suggested one).
    Copy this name to the clipboard, or write it down.
    Click OK to close the Save Import/Export Specification window.
    Click OK to close the Advanced window.
    Click Finish.
    Switch to the VB Editor.
    Make the DoCmd.TransferText instruction look like this:

    DoCmd.TransferText acExportDelim, "SpecName", "qryVLetterExport", strletterpath & strletterfile, True

    where SpecName is the name of the specification.

  5. #5
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    I have tried this, but get to the save as text delimited file and i get the following error: -

    Data type mismatch in criteria expression

    any ideas?
    Best Regards,

    Luke

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    Then you must have made a mistake somewhere in the export specification. When I created one in your database, the export went well.

  7. #7
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    Can you post the db back so i can compare?
    Best Regards,

    Luke

  8. #8
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    So I have been able to export to a text file now.

    However on click of the button i get the following now

    The text files specification "VLetter.txt" does not exist. You cannot Import, Export, Link using the specification.
    Best Regards,

    Luke

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Help on merge, cannot see what's wrong (2000)

    You're apparently using an incorrect name, or in the wrong place. "VLetter.txt" cannot be the name of the specification you created (a period in the name is not allowed.)

Posting Permissions

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