Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Print Right Most 2 Characters? (A2k (9.0.3821) SR-1 Jet 4.0)

    How to Print Right Most 2 Characters?
    A2k (9.0.3821) SR-1 Jet 4.0

    I

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Print Right Most 2 Characters? (A2k (9.0.3821) SR-1 Jet 4.0)

    The expression looks OK by itself. Make sure that:
    1. <LI>There is no typo (I know, it seems improbable, but I have fallen into that trap too often myself <img src=/S/blush.gif border=0 alt=blush width=15 height=15>)
      <LI>The control isn't named strLicenseYear - this would cause a circular reference.
      <LI>There is no another control named strLicenceYear bound to something different.
    If that doesn't help, see if you can display the rightmost two characters of another field, or of a constant:

    =Right("2003",2)

    Sometimes it helps to delete the control and create it anew.

    If the problem still occurs, switch to the Visual Basic Editor and check if there are missing references (Tools/References...)

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Print Right Most 2 Characters? (A2k (9.0.3821) SR-1 Jet 4.0)

    Hi Hans


    =Right("2003",2) worked OK

    References were OK

    Checked spelling, looked OK

    Deleted control and recreated it, same problem

    decomp, same problem

    Finally resorted to LicenseYear: Right([strLicenseYear],2) query record source to get it to work

    If I wanted to hunt this down, what would be my next step?

    Thanks, John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Print Right Most 2 Characters? (A2k (9.0.3821) SR-1 Jet 4.0)

    Only one more thought: could strLicenseYear refer to more than one field in the record source? If the record source is a query based on two or more tables, this could occur. In that case, you should prefix the field name with the name of the table (or query) it resides in:

    =Right([tblMyTable].[strLicenseYear],2)

    Otherwise, I wouldn't know. Anyone else with a bright idea?

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

    Re: How to Print Right Most 2 Characters? (A2k (9.0.3821) SR-1 Jet 4.0)

    When you use an expression like that in a query, you usually have to add the table reference anyhow because you no longer have it in there by default.
    Charlotte

Posting Permissions

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