Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Aug 2005
    Thanked 0 Times in 0 Posts

    Cant replace constant (Access 2000)

    I cannot replace the constant withing the following line:

    Public Const ValPath As String = "C:beArchiveBEBE.mdb "

    Shell """C:Program FilesWinZipWZzip.exe"" C:BEArchiveBEBE" & Format(Date, "yyyymmdd") & " C:BE"
    The above code is correct.

    replacing with valpath gives me an error :

    Shell """C:Program FilesWinZipWZzip.exe"" Valpath" & Format(Date, "yyyymmdd") & " C:BE"

    Can you help me correct the above line ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Cant replace constant (Access 2000)

    If you want to include a constant or a variable in a string, you must concatenate it with the other parts using &.
    Shell """C:Program FilesWinZipWZzip.exe""" & Valpath & Format(Date, "yyyymmdd") & " C:BE"
    BTW why do you include .mdb in the path? If you want to achieve the same result as the instruction that works, you should use
    Public Const ValPath As String = "C:beArchiveBEBE"</code>

Posting Permissions

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