Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default combo box not showing selected item..

hi,
i'm using the mousedown event on a an Office Excel 2003 user form combobox,
to trigger ADO calls to Access to populate the dropdown. I also clear out the
combobox each time, so the list doesn't duplicate each time it's clicked.
However, if mouse released (up), then selects an item and clicks (down), the
selected item does not show in combobox - it's always the 1st item in list
that shows.
If I do not release mouse (up), and select from list, it works fine. It's
like the mousedown event executes again when i select the item.

any idea as to how I could handle this? i'm pretty new to working with
mousedown/up events.

thanks!
Don


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default combo box not showing selected item..

Hi,
Not sure i get but:

- You could track whether an event occurs because of a direct user action or
because of your code has triggered some control's event. Set a variable
called UserTrigger as boolean.
- use it to manage when the code within an event should be executed:
- if the event is triggered because you are modifying things through code
then don't execute
- if the event is triggered because of actions from the user then do
execute

Private Sub ComboBox1_MouseUp( ... )
if UserTriggered then
'Start by setting UserTriggered to False
'Process code here which changes controls
'... (1)
'Reset UserTriggered to True
End Sub

eg, if you chancge a control in the above code at the leve of (1) (see
above) and this action triggers another control's _Change event. At (1), the
code jumps to that other control 's _Change code; however you know
UserTriggered is False, so avoid processing code in a If-Then.

I hope i was clear enough, ... not sure about that... :-)
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"nycdon" wrote:

hi,
i'm using the mousedown event on a an Office Excel 2003 user form combobox,
to trigger ADO calls to Access to populate the dropdown. I also clear out the
combobox each time, so the list doesn't duplicate each time it's clicked.
However, if mouse released (up), then selects an item and clicks (down), the
selected item does not show in combobox - it's always the 1st item in list
that shows.
If I do not release mouse (up), and select from list, it works fine. It's
like the mousedown event executes again when i select the item.

any idea as to how I could handle this? i'm pretty new to working with
mousedown/up events.

thanks!
Don


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excluding VAT for selected item triffidbook Excel Worksheet Functions 4 September 7th 06 08:20 AM
showing the # of times an item is entered in a column Foreplay_Man Excel Worksheet Functions 3 November 10th 04 04:28 PM
How to clear all item from a combo box? 39N95W Excel Programming 8 July 19th 04 07:31 AM
Highlighting ser selected item! aiyer[_16_] Excel Programming 1 May 10th 04 08:33 PM
Combo Box Item alfaboost Excel Programming 7 January 10th 04 06:31 PM


All times are GMT +1. The time now is 07:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"