473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ComboBox.Dropdown only works sometimes

675 512MB
I have a subroutine to dropdown the list portion of a ComboBox.
Expand|Select|Wrap|Line Numbers
  1. Private Sub QuickShow()
  2. 'Display Quick Dropdown ListBox
  3.     cboQuick = cboQuick.DefaultValue
  4.     cboQuick.SetFocus
  5.     cboQuick.Dropdown
  6. End Sub 'QuickShow
It works from anywhere it is called from, either Event subroutines or from other functions and/or subroutines. Except from one event sub, cboQuick_Click()

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboQuick_Click()
  2.    . . .
  3.     Call QuickShow
  4. End Sub 'cboQuick_Click
I can step through the code, and at the line End Sub 'cboQuick_Click the dropdown is removed, the list vanishes. It is there, and the downarrow will display it, but not automatically. I can put the line Call QuickShow as the last line of any other subroutine, and it works fine.
Any suggestions here?
Feb 14 '09 #1
1 1484
OldBirdman
675 512MB
So Access knows it is in the Click Event, and the normal end is to hide the list. So how do I stop the code before it can reach the end statement. Exit Sub doesn't do it. Stop only suspends execution.
I tried as the last line cmdX.SetFocus and then using the GotFocus event of cmdX to display the list, but Access gets Run-time error '2110' Can't move focus to the control cmdX. Don't know why not, perfectly valid control, visible, enabled, spelled correctly, and all that.

OK - problem solved. Caption of cmdX is &Button and I use the SendKeys"%B") to give the focus to cmdX. I will make this control too small to see, but visible.

There is nothing like trying to present a clear problem to this forum to clarify thinking, reduce the problem to its essentials, and perhaps find an answer.

OldBirdman
Feb 14 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
7
by: NCrum | last post by:
I want to set the Default value of a Combobox for any changeable record and have got this working but it is totaly unsatisfactory see the code below I loop through the items in the Combo looking...
0
by: Rene | last post by:
For fun, I am developing a combobox control look-alike. The only way that I was able to accomplish creating a dropdown list was to basically show up a form right underneath my custom combobox...
12
by: AnAnimal | last post by:
Is it possible to make the text box portion of a ComboBox (in DropDown style) behave like a TextBox? By that I mean can it allow the user to select a portion of text by hilighting it with the...
0
by: Mike | last post by:
Hi all! I have an OwnerDrawVariable ComboBox in .net. In the ComboBox DropDown event I display another control - works well. In the control's Leave event I remove the control - works well. So...
4
by: Kalvin | last post by:
I have seen this question raised, but I cannot find an answer. I have an MDI app, when I load an child form with a combobox being bound in the load event, it won't allow me to set selectedindex =...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
1
by: amber | last post by:
I'm having an issue with a combobox that is making no sense to me at all. I have a form with several comboboxes/textboxes. The values in these boxes are based on a datarowview, which is based on...
2
by: Vidhura | last post by:
My application contains 2 tabpages.The second tabpage contains panel .The panel contains series of combobox and textboxes. If the item not selected in combobox and the user click on the another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.