Translating Query text from Multi List (ViP Specific)
At 27 MAR 1998 11:50:45AM F. Robinson wrote:
The Notes database I am trying to query has a "State" column, however it is populated with abbreviations, i.e. GA, AL, FL, TN, etc.My Multi list box has the names of the states spelled out, i.e. Georgia, Alabama, Florida, Tennessee, etc.Using the standard link formula for SetQueryfromMultiList, how do I translate the full text to the abbreviations I need to set the query, insofar as S$ is redefined in the formula.I have tried using SELECT Case, and it works on single selections, but all others will not translate to abbreviations. I have moved the select case around in the formula, no help. I tried SELECT Case S$ and SELECT Case Index%, but can't seem to hit on the right combination.Example:
SELECT Case S$
Case 1
"Florida":"FL"Case 2
"Georgia":"GA"Etc…..
End Select
Do you have any suggestions on how to make multiple selections translate from text to abbreviations?Thanks in advance
At 27 MAR 1998 02:49PM John Averell Revelation wrote:
I'm not certain what you are querying against, a Notes View or a Notes Form. Anyway, I think you are going to have to hard-code a full select list of all states in script and make up your query this way.
==============
c$="
p%=list1.ItemGetNextSel(0)
do while p% 0
s$=list1.ItemGet(p%)
p%=list1.ItemGetNextSel(p%)
select case s$
case "Georgia"c$=c$ + ":""GA"""case "Alabama"c$=c$ + ":""AL"""case "Connecticut"c$=c$ + ":""CT"""case "Massachusetts"c$=c$ + ":""MA"""end select
Loop
if (Len(c$) ] 0) then 'strip off leading :
c$=Mid$(c$,2)
End If
================
This will produce a string like this:
"AL":"MA"
for example.
But this string is not a proper criterion for a Notes form. You can play the same game but should end up with a string like:
Col1=AL" OR Col1=MA"
Then you can do a Data1.CellSetQuery(1,1,c$) and execute.
Hope this answers you question.