Results 1 to 3 of 3

Thread: TransferDB (97)

  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TransferDB (97)

    HELP!!

    Below is code I want run which exports tbls to an existing db. I want to specify the path and I want to specifiy the name of the existing db (as the name changes daily). If I run the first xfer..it works fine..(i must specify the name of the db), however, if I run the second xfer, it fails telling me that the db doesn't exist and uses the "strExport" as the db name....can someone please take a look at this code and tell me what I need to change.

    Thanks,

    Dim stDocName As String
    Dim stQryName As String
    Dim strExport As String

    strExport = Me!NewDBName & Me!File

    DoCmd.TransferDatabase acExport, "Microsoft Access", ("clpims40.mdb"), acTable, "030102G", "030102G", False
    DoCmd.TransferDatabase acExport, "Microsoft Access", ("vuballkellykstrExport"), acTable, "RPT HMHS Form Send for Ance-Grp-Hosp", "RPT HMHS Form Send for Anc-Grp-Hosp", False
    DoCmd.RunCommand acCmdClose
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TransferDB (97)

    If strExport contains the path and the file name (ex: c:datafile.mdb) use
    DoCmd.TransferDatabase acExport, "Microsoft Access", strExport, acTable, "RPT HMHS Form Send for Ance-Grp-Hosp", "RPT HMHS Form Send for Anc-Grp-Hosp", False

    If strExport contains only the file name (ex: file.mdb) use
    DoCmd.TransferDatabase acExport, "Microsoft Access", "vuballkellyk" & strExport, acTable, "RPT HMHS Form Send for Ance-Grp-Hosp", "RPT HMHS Form Send for Anc-Grp-Hosp", False
    Francois

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TransferDB (97)

    Thank you very much...amazing what a little " will do for ya...appreciate it..
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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