PDA

View Full Version : Solved: DocVariable size limitation?



jcd1981
02-21-2006, 02:22 PM
Hello Forum, this is my first post. I would appreciate any help that anyone would be able to provide me.

I have written a search functionality into one of my VBA apps that allows a user to drill down into lists of filters to see a specific result set in Combo Boxes based on what filters were selected. Currently the functionality is working, but now I am trying to load the FULL list into a DocVariable instead of just a short list for testing. Its a 4 Column X 1622 Row list of categorized items.

The problem is this: When trying to load the DocVariables, I seem to have hit some sort of limitation... Perhaps a size limit. Normally, when I reload a shorter table into doc variable, I am able to see everything as intended, but when I load the longer list, 1 of 2 things have happened:

1) The original short list is still in the document and the long list just never shows up
2) A couple times, I stepped through the code i use to build the docvariable, and everything seemed fine all the way through. When I looked at the lists, instead of 1622 populated rows, I had 3 populated rows, 1 row partially populated, and 1618 rows that consisted of blanks ("", "", "", "")

Any ideas that anyone might have would be greatly appreciated!

jcd1981
02-21-2006, 05:00 PM
So after a little more digging through someone elses code, I managed to find the error, which is what I figured it was anyway.

So I broke the tables into 4 separate docvariables, and then reloaded them into Variants. I attached a screenshot of the watches to this message.

Now I need to re-combine the variants, and dont have any bright ideas of the top of my head.

Any suggestions?

TonyJollans
02-21-2006, 05:39 PM
Hi jcd1981,

Welcome to VBAX!

I'm not entirely sure what you're doing. Are you trying to load an array into a doc variable? I'm not sure that's possible.

As for combining strings, take a look at the Join Function.

jcd1981
02-22-2006, 10:06 AM
I am breaking the array down into a string, and rebuilding it in code when I launch the form. So I have no trouble storing the doc variables (if they are small enough) Problem is that the most recent addition is far too long (in string format) to fit in the doc variable field. So I broke it into 4 pieces, loaded 4 seperate strings (each their own array). Now in code, when I turn the strings back into an array, I need to combine the arrays somehow.

The only other thing I can think of is to break the single array into 4 strings before loading (rather than 4 arrays) and recombine the strings before I rebuild the array. Might be another possibility to check out.

TonyJollans
02-22-2006, 12:47 PM
Sorry but I'm still not sure I'm following what is a string and what is an array.

You convert an array into a string - you have this and it works?
You break the string into, say, four smaller strings (if need be) - you have this and it works?
You save the strings as a doc variables - you have this and it works too?

You recombine the short strings into one long string - you don't have this?
e.g. LongString = Short1 & Short2 & Short3 & Short4

You convert the long string back to an array - do you have this?

Am I close?

jcd1981
02-22-2006, 01:12 PM
Sorry, its because im trying 2 things at once.

"You convert an array into a string - you have this and it works? Yes
You break the string into, say, four smaller strings (if need be) - you have this and it works? Yes
You save the strings as a doc variables - you have this and it works too? Yes

You recombine the short strings into one long string - you don't have this? I didnt before, but I am working on it now. I was trying to combine the arrays without breaking it down to a string first. Now I have changed my methodology, and am working on combining the strings instead of the arrays.
e.g. LongString = Short1 & Short2 & Short3 & Short4

You convert the long string back to an array - do you have this? Will do this after finishing the previous question

Am I close?" Yes

Thank you for your patience BTW. I think it helps just to talk through it.

TonyJollans
02-22-2006, 02:05 PM
I think it helps just to talk through it.

Definitely. I have 'solved' many problems without doing anything more than listening while someone else clarified what they were doing enough to put it into words.

The combination of the short strings into a longer one is exactly as per my example - using the "&" concatenation operator.

jcd1981
02-22-2006, 02:41 PM
Perfect. Problem solved. By combining the strings BEFORE rebuilding the arrays, it became a MUCH easier thing to tackle.

Thanks for turning an ear. :hi: