Results 1 to 6 of 6

Thread: Crystal Report?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Crystal Report?

    Hi,

    I didn't know where else to post this question so I thought I'd try here. I have a formula that is giving me an error that I don't know how to resolve. Here is my code

    VB Code:
    1. If Length ({tblVendor.venAddr2}) > 0 Then
    2.     Trim ({tblVendor.venAddr2})  
    3.     Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+"  "+{tblVendor.venZipCode})
    4. Else
    5.     Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+"  "+{tblVendor.venZipCode})

    The error message is:

    "The remaining text does not appear to be part of the forumula"

    It bombs at the beginning of the 2nd Trim statement in the If branch. I tried using the continuation character "_" and the end of the Then and also using an End If statement and neither of those worked.

    Anyone have any ideas?

    Thanks,

    Blake

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Crystal Report?

    The problem is in the line:
    Trim ({tblVendor.venAddr2})
    Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+" "+{tblVendor.venZipCode})

    It should be:
    Trim ({tblVendor.venAddr2}) + " " +
    Trim ({tblVendor.venCity}+", "+{tblVendor.venState}+" "+{tblVendor.venZipCode})


    You are missing a plus sign (+) after venAddr2 and before venCity
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Crystal Report?

    Gary,

    If I use that method...both lines end up coming out as 1 line and I want 2 separate address lines.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Crystal Report?

    Moved from Classic VB
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Junior Member
    Join Date
    Feb 2006
    Posts
    27

    Re: Crystal Report?

    If you want 2 separate address lines you could try using chr(13)

    Regards,
    Tribo

  6. #6
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Crystal Report?

    I wrote that the way you had it only. I do the same thing in my reports also but Name the functions Line 3 and line 4. If the second address line is empty the line line 3 becomes the city,state and zip and line 4 is empty. If the second address line is not empty then line 3 is the second address line and line 4 is city state and zip. Both funcitons are placed on the report.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Posting Permissions

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



Click Here to Expand Forum to Full Width