Results 1 to 5 of 5
  1. #1
    MRoberts
    Guest

    Carriage return problem (Access 2000 SP2)

    Trying to concatenate fields in a make-table query with this expression to include a carriage return:

    PrimaryAddress = [tblMailList]![strAddress] & Chr(13) & Chr(10) & [tblMailList]![strCity] & ", " & [tblMailList]![strState] & " " & [tblMailList]![strZipCode]

    results in this error message:

    "Undefined function 'Chr' in expression."

    Using vbCrLf in place of the Chr's results in it being treated as a field name.

    Can someone explain the error in this expression?

    Thank you for any and all help with this problem!

  2. #2
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Carriage return problem (Access 2000 SP2)

    [Stab in dark] No reference set to the VBA library? [/Stab in dark]
    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

  3. #3
    MRoberts
    Guest

    Re: Carriage return problem (Access 2000 SP2)

    Thanks, Shane!

    There are references to both "Visual Basic for Applications" and "Microsoft VBA Extensibility 5.3".

    However, now I see that there is a reference "MISSING: Microsoft DAO 2.5/3.5 Compatibility Library". Can someone tell me what that means and/or how it can be fixed?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Carriage return problem (Access 2000 SP2)

    Change your reference to the DAO 3.6 Object Library and get rid of the compatibility library reference all together. If your code breaks, fix the code. The compatibility libraries are used to keep legacy code running but they teach you bad coding habits and the code itself can break if you import it into a new database.
    Charlotte

  5. #5
    MRoberts
    Guest

    Re: Carriage return problem (Access 2000 SP2)

    Charlotte - Thank you so much!

    The carriage returns are not working yet (I'll fix the code) but the error messages are gone - YAY!

Posting Permissions

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