Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Macro Code Help (2k3)

    Hi, a friend of mine is trying to get some code to run in his database that he can't seem to get to work and i was unable to really help him with his code. maybe someone here can help? he has a code that is run through a macro with a Run Code line in it with the function "remSpaces(prt info)" called out. he says it runs but it doesn't actually do what it is supposed to do. what it is supposed to do is take a dimensioned part: .035X5X4 and break it out into its different individual dimensions in different columns: gage, width, height, and type (type is based off how many dimensions are given). he showed me that in the table there are many data that haven't been broken down though for whatever reason and he asked me if i knew what was wrong (i didn't <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>). i attached the code because its kind of long. thanks!

    Edit: also, how do you run the code of a function line by line in access to see where something might be going wrong? i can't remember!
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

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

    Re: Access Macro Code Help (2k3)

    You'll have to provide a table with examples that work and examples that don't work.

    To test a function or procedure, set a breakpoint at the beginning - either click in a line and press F9 or double click in the gray margin to the left of the line. Code execution will stop there; you can then single-step through the code by pressing F8.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Macro Code Help (2k3)

    Hans, he sent me over an excel sheet with part of the table in it (see attached). From what he says "it worked when the access programmer who worked here wrote it, but it doesn't anymore, and now he's gone" <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15> very descriptive, i know.

    is this table any help?
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

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

    Re: Access Macro Code Help (2k3)

    Try changing the lines

    Else
    If Not IsNumeric(Left(strSize, intP - 1)) Then GoTo skipthis

    to

    Else
    If Not IsNumeric(Left(strSize2, intP - 1)) Then GoTo skipthis

    Note: the first line

    If Not IsNumeric(Left(strSize, intP - 1)) Then GoTo skipthis

    should remain unchanged.

  5. #5
    5 Star Lounger
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Macro Code Help (2k3)

    He got back to me friday and said the change worked. Thanks Hans! (for making me look good) <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>


    I did actually credit HansV @ Woody's Lounge
    <img src=/w3timages/blueline.gif width=33% height=2>
    <big>John</big>

Posting Permissions

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