How can I pull a BO variable's value into my VB macro?

I have a macro where I apply a complex filter (Customer Name) to my report and then try to grab a BO variable value (Customer ID) that is uniques to the Customer Name). When I try this using the following code,
I get a Runtime error 206: #multivalue error message

Call boReport.AddComplexFilter("PARENT_CUST_NAME", "=<PARENT_CUST_NAME>=" &amp; Chr(34) &amp; vAccount &amp; Chr(34))
    
boReport.ForceCompute
    
sAcctID = ThisDocument.Evaluate("=<PARENT_CUST_ID>", Val(boCell))

Does any one know how to fix this? I’ve tried many other properties besides “val”, but I keep gettign the same error message.

Your help is appreciated.

-R


rCurtis (BOB member since 2003-12-22)

You might want to take a look at the code in this sample from the Integra Solutions site. It will show you some options. 8)

Moved to SDK forum.


Dave Rathbun :us: (BOB member since 2002-06-06)

Thanks for the quick response!

My existing macro basically does the same thing, but the piece that I can’t get (that example does address it) is how can a pull another value from the report in? Using that sample, you’ve created a filter on Resorts. Now what if you wanted to pull in the resort ID into your macro?


rCurtis (BOB member since 2003-12-22)

Meaning the Resort ID value that matches the Resort that you have already selected?

That, I’m afraid, is not really possible. What I have resorted to in the past (pun intended) is to export the data provider (or possibly a report) to a text file, then read that text file into an array using VBA. As an array, I can reference the entire row.

BusinessObjects doesn’t give you the capability to do a vlookup() or hlookup() type of function, unfortunately.


Dave Rathbun :us: (BOB member since 2002-06-06)

That’s the one I’m going for.

I ended up creating a Report variable that took the “Resort Name” value and concatonated “~Resort ID” and brought all of these values into an array. When I’m looping through the ResortNames array, I can now just grab the same # in the array for ResortNAME&ResortID (after parsing to the “~”. These match because they have the same sort order - that’s why I had to concatonate the Resort Name rather than just bring in ID alone - otherwise the two arrays ar out of sync.

Thanks.


rCurtis (BOB member since 2003-12-22)

Sounds like a workable solution to me. 8)


Dave Rathbun :us: (BOB member since 2002-06-06)