[program-l] Re: VB6: Click Event of a Combo Box

  • From: "Mark Long" <Mark.Long@xxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Fri, 9 Sep 2005 14:54:39 +0100

Uh, surely that is what you get?

Do you have a bigger code fragment? 

-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx [mailto:program-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Corbett, James
Sent: 09 September 2005 14:44
To: Program-L (E-mail)
Subject: [program-l] VB6: Click Event of a Combo Box

Hello all:

I am using a Combo Box with its Style property set to 2. The Combo Box is 
populated during the form load event with a query to a table. During the 
population, I reset the index with:

Do while not rs.eof
        cbx.additem rs.fields("field").value
cbx.itemdata(cbx.newindex) = rs.fields("Auto Number Field").value loop

So, essentially what happens here is that the index values get repopulated.
My issue is that I want to use the index value during the click event to 
repopulate other controls on the form but due to the new order of values I 
can't seem to return the expected value thus screwing up my secondary query.

Is there an event that  would return a more accurate value? In other words if I 
press the down arrow, I want the value of the item that I land upon.

Jimmy 

James M. Corbett

(613) 941-8303 | facsimile / télécopieur 613 941-8720 | TTY/ATS
1-800-665-0354
James.Corbett@xxxxxxxxxxxxxxx
IT Programmer/Analyst | GST/HST Division | Information Technology Branch 
Programmeur/Analyste en technologie de l'information | Division de la TPS/TVH | 
Direction générale de l'informatique Canada Revenue Agency | 875 Heron Rd., 
Ottawa, ON K1A 0L5 Agence du revenu du Canada | 875 Ch. Heron, Ottawa ON K1A 
0L5 Government of Canada | Gouvernement du Canada

"It's 106 miles to Chicago. We got a full tank of gas, half a pack of 
cigarettes; it's dark and we're wearing sunglasses."

Elwood Blues


** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: