Results 1 to 10 of 10

Thread: [RESOLVED] Program errors on Chr, Trim, UCase

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    Resolved [RESOLVED] Program errors on Chr, Trim, UCase

    I downloaded a VB6 program from planet source code for sign-language.

    Trying to modify it to run in VB5 so I can compile and give it to our local visually impaired organization.

    For whatever reason, the program errors on Chr, Trim, UCase. Even changing these references to Chr$, Trim$, UCase$ still cause an error.

    Anyone have:

    1) Any ideas.
    2) Willing to try the attached in VB6 and let me know if it works.
    Attached Files Attached Files

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Program errors on Chr, Trim, UCase

    You can fix it by placing "VBA." qualifier in front of every occurrence of those functions or by recreating the project (create new project and add all existing objects).
    Sorry but I am not aware of any better way...

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    Re: Program errors on Chr, Trim, UCase

    Rhinobull:

    Thanks for feedback.
    Good idea trying VBA Qualifier first. Something I would of never thought of.
    Will leave thread open for couple days or until resolved.

    Have a nice evening.
    David

    ======== Followup ==============
    Used VBA Qualifier and program works like a charm.
    Hats off to you.
    I know SAVAII will appreciate the program.

    David
    Last edited by dw85745; Jan 4th, 2011 at 11:56 PM. Reason: FollowUp

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [RESOLVED] Program errors on Chr, Trim, UCase

    A better way is to check for missing references, as that only takes a few seconds, and based on many hundreds of previous threads it is usually the cause of the problem.

    The time to fix a missing reference is usually low (sometimes a matter of seconds in total), and it is always a permanent fix - whereas dealing with the symptoms as suggested above needs to be done to any code you add/alter in future.

    There are more details of checking missing references (along with other options for solving the various causes of problem) in the "Fixing common VB Errors" link in my signature.

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: [RESOLVED] Program errors on Chr, Trim, UCase

    Quote Originally Posted by si_the_geek View Post
    A better way is to check for missing references, as that only takes a few seconds, and based on many hundreds of previous threads it is usually the cause of the problem...
    "Usually" is the key here but it's not really always - I cannot recall at least one case when references to VBA were missing. They were always in place so for me it was a matter of applying technique I've mentioned earlier.

  6. #6

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [RESOLVED] Program errors on Chr, Trim, UCase

    I have never seen the VBA reference itself be missing, nor heard of that happening - but when there is a missing reference it is usually items in the VBA library that the error shows for (as I've proved to you in the past with simple test projects).

    I have given a brief explanation of a potential cause for it in the "side note" in the article, but of course we can't be sure because we don't have the code etc for the compiler.

    As it only takes literally a few seconds to check the references screen, does it really hurt to try it first?
    Last edited by si_the_geek; Jan 5th, 2011 at 09:30 AM. Reason: fixed typo in tags

  8. #8

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    Re: [RESOLVED] Program errors on Chr, Trim, UCase

    si_the_geek:

    Thought I give a little feedback as what was occurring going from VB6 to VB5.

    1) Loaded project and bypassed Retained and DebugKey not found prompts. (this is normal)
    2) Tried to run program from IDE and failed on a number of VBA methods (Chr, Trim, etc.0
    3) Checked references and found two missing.
    4) Checked my system for these references and not installed.
    5) Checked web and found references most likely belonged to an enterprise development not professional Based on references figured they could be deleted.
    6) Deleted missing references from VBP file.
    7) Checked if program used ADO. It didn't so deleted reference to ADO from VBP.
    8) Tried to run program from IDE and still failed on VBA methods.
    9) Created a new standard blank VB5 project and compared references.
    10) All references between both projects appeared to be same.
    11) Another run from IDE attempted. Failed again on VBA methods.
    12) Post to forum where Rhinobull solution worked.

    Can't explain why this particular program would need the VBA object reference but it did.

  10. #10
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [RESOLVED] Program errors on Chr, Trim, UCase

    It seems that missing references were at least part of the problem... and either there is something else causing problems too, or your attempts to fix the references were not successful.

    It isn't clear from what you posted, but I get the impression there is no longer anything marked as missing - in which case that part is fine, and there is another cause.

    Could you upload the project (including all code files etc), and preferably also the .vbp for a new blank project?

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