Results 1 to 7 of 7
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Figuring out an array

    I've inherited a module that includes an array that I can't figure out. Any explanation of what is causing a problem is greatly appreciated!!



    Within the attached DB, the module reads the record from the table Monument_Current. Within 1 field, wbs code, the array breaks it down. It writes a new record into Monument_Current_Split.

    I started with a spreadsheet that has 1900 records, and it works except for this record.

    Thank you in advance
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    I step debugged your code and get error: The field is too small to accept the amount of data you attempted to add.

    on the line

    wbs_rsAdd!Expense_Account_Unit = ARY2(ii)

    and ARY2(ii) has value of

    6707827-218800520

    except the hyphen doesn't look like a hyphen in the intellisense popup.


    You should have seen that error message as well.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Yes, I've received the error message. Thanks for providing me a greater detail as to what is causing the error.

    Any recommendations as to learning more of how this array functions. I've looked at arrays on the Microsoft website, but they don't look like detailed.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Nope, I figured them out by reading various sources, including MS Knowledge Base and trial and error.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Sounds like I have a fun night for me. I normally use F8(Step Into) to follow the code. How can I better see what is happening?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,649
    Review link at bottom of my post for guidance on debugging techniques.

    Here is another article from Pearson, one that probably helped me a long time ago http://www.cpearson.com/excel/VBAArrays.htm
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks. I figured out the problem. Within that field, the dash that was between "6707827 - 218800520" was CHR(150) rather than CHR(45). When I inserted a replace command, everything worked fine. Thanks for your assitance, and I'll review the links you've mentioned.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Really close to figuring out this import issue
    By nhylan in forum Programming
    Replies: 3
    Last Post: 04-23-2013, 11:31 AM
  2. delete
    By steelcurtain11 in forum Access
    Replies: 1
    Last Post: 03-12-2013, 11:57 PM
  3. I need help figuring out an iif function..
    By kduznetsov in forum Access
    Replies: 1
    Last Post: 03-30-2011, 10:07 AM
  4. Not figuring out dlookup (RunTime 2465)
    By Gilligan in forum Access
    Replies: 10
    Last Post: 03-08-2011, 02:48 PM
  5. Need help figuring out stuff
    By Buakaw in forum Access
    Replies: 3
    Last Post: 01-31-2011, 02:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums