none
Error in SQL RRS feed

  • Question

  • Good afternoon. I have an sql instruction like that:

    ...IN 'CurrentProject.Path & " \ historicoapolice.mdb '" & _ But it gives me error

    But if i put like this:

    ....IN ' C:\loja seguros\ historicoapolice.mdb '" & _ it does not matter anymore.


    The "historicoapolice.mdb" is a database to store customer history. In the main MDB there is a button. Clicking executes the sql statement and sends the selected tab to history. It is not connected to the main. I would like the sql statement to run anywhere where the mdb was installed, since the folder is the same for both mdb's.
    So, rather than ....IN ' C:\loja seguros\ historicoapolice.mdb '" & _, i would like this......IN 'CurrentProject.Path & " \ historicoapolice.mdb '" & _ But it gives me error. Must doing something wrong, but what?


    What i'm doing wrong? Can someone help me? Thank you
    Wednesday, September 12, 2018 8:16 PM

All replies

  • ...IN 'CurrentProject.Path & " \ historicoapolice.mdb '" & _ But it gives me error

    Hi Kidmania,

    As you want the value of CurrentProject.Path and not the literal text, it must be outside the quoted string.

    So try something like:

    "... IN '" & CurrentProject.Path & "\historicoapolice.mdb'" & …

    Imb.

    Wednesday, September 12, 2018 8:56 PM
  • Thank you. Now its exporting the data. Resolved
    Wednesday, September 12, 2018 9:56 PM