This topic is locked

Multi-dimensional Array

3/19/2004 9:26:36 AM
ASPRunnerPro General questions
B
bblazewink author

Hello,
I am trying to populate a couple of drop down boxes for selection. I posted before on this, but I am wondering if, in the section of BuildSelect control where the strSQL is getting the values, can a muli-dimensional array be declared here? I assume, also, that the section below

while not rsTemp.Eof

if rsTemp(0)=strValue then

BuildSelectControl = BuildSelectControl & "<option value=""" & rsTemp(0) & """ selected>" & rsTemp(1) & "</option>"

else

BuildSelectControl = BuildSelectControl & "<option value=""" & rsTemp(0) & """>" & rsTemp(1) & "</option>"

end if

rsTemp.MoveNext

wend
BuildSelectControl = BuildSelectControl & "</select>"
rsTemp.Close

set rsTemp = Nothing

else

would need changed to 'read in' the 2nd or 3rd column values..
Just not sure how to go about this...maybe I can use a get rows method in the SQL query?
Very new to asp, and am really stuck on this one. I know I need to modify the generated code, and am aware of the different methods, just not sure which/how to implement.

I would surely appreciate any pointers you could provide.

On my earlier post, Sergey answered to load the values when the page loads. Couldn't I also do that within the Buildselect....?
Sorry so lengthy,

B

Sergey Kornilov 3/19/2004

I'm missing the point.
Why do you need multidimensional array?

B
bblazewink author 3/19/2004

Hello, Sergey,
Well, I had placed the column values I needed in the Select statement that is generated by ASPPro per your advice, Select [CustomerCode], [CustomerCode] + [CustomerName] + [CustomerPhone], etc...and I saw that it only saved the key field into my database instead of the whole strSQL...so I thought maybe it couldn't 'see' those other columns until you poulated it with an array..don't laugh, please...I am at wit's end and missing the obvious, no doubt! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1423&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
B

Sergey Kornilov 3/20/2004

try the following SQL query:

Select [CustomerCode] + [CustomerName] + [CustomerPhone], [CustomerCode] + [CustomerName] + [CustomerPhone] from ...

B
bblazewink author 3/22/2004

Sergey,
Ahhh...finally the lightbulb turns on, thank you! How can I then save the additional fields shown as options into their appropriate text boxes?
What I mean is, now my

CustomerCode drop down displays AND saves both (CustomerCode and CustomerName) values into the same field. Can I make the second or 3rd values save to their appropriate place in the database or text fields on my form?
Brenda

Sergey Kornilov 3/23/2004

You use some javascript to parse drop-down box selection value and populate other textboxes on the edit page.
I don't have "ready to go" code to achieve this. I can recommend you take a look at drop-down onChange event.