+ Reply to Thread
Results 1 to 5 of 5

vba array type missmatch

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    vba array type missmatch

    Hi,

    im trying to extract values from an array that i have filled with an sql statement, only problem is i get a type missmatch error?
    it could be that the array is very large! maybe 400 entries

    Please Login or Register  to view this content.
    idtsd is defined as a variant

    thanks
    Last edited by Jollyfrog; 11-10-2010 at 10:33 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: vba arrar type missmatch

    It would help if we could see how idtsd is itself defined ... also do you have members within the array that contain apostrophe's ?

  3. #3
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    Re: vba arrar type missmatch

    members did contail apostrophies, so i altered the code, however it must have been erroring before it got to them,

    Please Login or Register  to view this content.

    the arrar is populated on line 30

    thanks

    Jonathan

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: vba array type missmatch

    Sorry for delay.

    Without wanting to get too involved in optimisation at this stage - I've not a database to test against presently - but when you step through the code using the Locals Window how is idtsd defined ?

    Assuming idtsd definition is ok (ie an appropriate Array) then does the SQL generate as you expect, ie add a debug prior to the execution line and review in Immediate Window:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    Smile Re: vba array type missmatch

    Ok,

    so i pasted in a whole bunch of debug lines and it turns out one of my if statements was out,
    triggering on if EOF = true not false.. so the array never populated and errored out!

    problem solved :D

    thanks for your time and help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1