Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Nov 2003
    Posts
    267

    Unanswered: Problem with Right Function in a query

    I have a query that works fine when I am testing it, it works fine, but when I I run it at the clients location I get errors

    The part of the query that has problems it

    SLSTTREATYEAR: Right([TemptblSecPlan3TreatsOrgData]![SLSTTREATYEAR],2)


    SLSTTREATYEAR is a 4 digit number representing a year

    I know it is the right function. Both my location and the client's are using the same references.

    Anybody got any ideas what could be the problem.

    S-

  2. #2
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Re: Problem with Right Function in a query

    Originally posted by sbaxter
    I have a query that works fine when I am testing it, it works fine, but when I I run it at the clients location I get errors

    The part of the query that has problems it

    SLSTTREATYEAR: Right([TemptblSecPlan3TreatsOrgData]![SLSTTREATYEAR],2)


    SLSTTREATYEAR is a 4 digit number representing a year

    I know it is the right function. Both my location and the client's are using the same references.

    Anybody got any ideas what could be the problem.

    S-

    We have the same problem --> different Access version (XP <--> 2003), but don't have a solution yet.

  3. #3
    Join Date
    Nov 2003
    Posts
    267
    bump

  4. #4
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Question Re: Problem with Right Function in a query

    Originally posted by sbaxter
    I have a query that works fine when I am testing it, it works fine, but when I I run it at the clients location I get errors

    The part of the query that has problems it

    SLSTTREATYEAR: Right([TemptblSecPlan3TreatsOrgData]![SLSTTREATYEAR],2)


    SLSTTREATYEAR is a 4 digit number representing a year

    I know it is the right function. Both my location and the client's are using the same references.

    Anybody got any ideas what could be the problem.

    S-
    What type of errors?
    Gregg


    DAO, ADO, SQL, Automation and anything else I can pick up.

  5. #5
    Join Date
    Nov 2003
    Posts
    267
    The Error I get is instead of a Number (2 digit year) in the query output, I get "#Error"

    S-

  6. #6
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    More than likely it is a missing reference. Check your references and you will probably see one is MISSING. Whenever you have bad references one of the first things to stop working is built in VBA string functions like Right, Left and Mid.

  7. #7
    Join Date
    Nov 2003
    Posts
    267
    As you will notice from my orginal post, all sites (I actually have a few sites where it doesn't work at) have the same references (and none are missing).

    However, the thought of having an existing reference go Bad, does that happen? And what are the odds of going bad a several locations?


    thanks
    S-

  8. #8
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    It all depends on what you are referencing. I reference other Access databases. I put most of my code in one database and then set a reference to that database in any database that needs the code, that way I don't have multiple copies of the same code everywhere. But if I move the code database somewhere else it will cause the reference to be missing.

  9. #9
    Join Date
    Nov 2003
    Posts
    267
    When I say references maybe I am confusing some people (or else I'm the one thats confused), I am talking about the VBA library references.

    S-

  10. #10
    Join Date
    Nov 2003
    Posts
    267
    Bump

    Any other thoughts

    S_

  11. #11
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile

    Originally posted by sbaxter
    Bump

    Any other thoughts

    S_
    I understood what you meant concerning references. And, I have had occasions where references had to be reset but usually it was my own fault for moving the Db from one Office version to the other.

    Have you tried to run the same function in a code window of the clients machine? How about the Left function or Mid function? Will either of those work in the QBE?

    I did a quick search of the knowledge base and got nowhere there. Only reference I saw was concerning truncating characters in memo fields.

    Sorry, no quick answer here.

    It's just a machine right? Surely we should be able to exercise our right to dominate it!
    Gregg


    DAO, ADO, SQL, Automation and anything else I can pick up.

  12. #12
    Join Date
    Nov 2003
    Posts
    267
    Thanks for your help basicmek


    S_

  13. #13
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Judging from the sytax, it looks like you're retrieve in a query the contents of a control on a form ... Is this correct? The purpose would be to have that value as a column correct? To what purpose is this query? For a report? Form? Intermediate table? I'm looking at other avenues for you to get the value you need depending on the purpose you need it for ...

  14. #14
    Join Date
    Mar 2004
    Posts
    1
    are you sure that your references are really working?
    Try to de-select all references that you can, close the database, open it again and re-select them.
    To check if references are broken see http://www.microsoft.com/IntlKB/Germ...D36/D36818.htm

    llap
    Robert

  15. #15
    Join Date
    Nov 2003
    Posts
    267
    Originally posted by M Owen
    Judging from the sytax, it looks like you're retrieve in a query the contents of a control on a form ... Is this correct? The purpose would be to have that value as a column correct? To what purpose is this query? For a report? Form? Intermediate table? I'm looking at other avenues for you to get the value you need depending on the purpose you need it for ...

    TO display as a query datasheet to be outputed to .xls

    The real kicker, which is was just informed of, is this same query is also used as the bases of a report and the data looks fine in the report.

    S-

Posting Permissions

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