473,395 Members | 1,742 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 Thread

Hello,
I posted a msg on the Access-related groups in hope someone there
could help me but since almost two days have past and I didnt get a
response (Im a bit hard pressed with the problem) I thought I might
try some of you guys since you also deal with the Visual part of
visual basic and since vba shouldn`t be all that different from vb....
(I changed the order of the post and edited the junk out a bit to make
it a bit more readable but nothing except that)
"Oren Kaplan" wrote:
Hello All,
I have a ComboBox on my 'Main' Form (the Form is not data
bound, the ComboBox is) which i want the user to be able to
pick from and click on a command that gets the data from the
first column (4 columns are shown) and uses it in some way....
- At first it looks like this:

___________ _ |¯¯¯¯¯¯¯¯¯|
|Select Here|V| | Command |
¯¯¯¯¯¯¯¯¯¯¯ ¯ |_________|

- When you click on the arrow it cascades:

___________ _ |¯¯¯¯¯¯¯¯¯|
|___________|V|_________ ___________ ___________ _ | Command |
| Main ID |¯ Desc. 1 | Desc. 2 | Desc. 3 |^||_________|
|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯ |
| Records | For | User | Selection |_|
|___________|___________|___________|___________|V |
¯
- When you select a record from the list it shows the 'Main
ID' you selected in the text portion of the ComboBox:

___________ _ |¯¯¯¯¯¯¯¯¯|
| Main ID |V| | Command |
¯¯¯¯¯¯¯¯¯¯¯ ¯ |_________|
- And then when you click the Command you can refer to
ComboBox`s value and call a Sub or Function using that value.

Thing is... The ComboBox doesn`t display its DefaultValue at
the begining and when I move the mouse over a record it only
'selects' it, as in highlights it in black, and clicking on
them doesn`t make any difference. In the end the text portion
of the combobox is either empty as usual or full with some
spaces...

Help anyone? Using Access2k over Win2K or NT4.....

Thanks ahead,
Oren


Hey Arvin,
You wrote:
Nice Ascii art! Thanks for not posting a nice fat jpg.

<snip>
thanks :) I had to - I didn`t manage to explain my self in a better
way in words and I wouldn`t have gone to the trouble of screen
capturing anything just for that.
<snip>
I'd use the AfterUpdate of the combobox instead of the command button click
event to run your code.

<snip>
The problem is, though - that the d**n control doesn`t even produce
that event! It doesn`t even get to the point where it changes... I
can`t type in anything and can`t select anything from the list! As
for everything else, well, thanks alot - I`ll keep it on the thread
if others want it but I still need someone to try to understand why
one three different computers and two different systems the combobox
simply won`t let anything happen to it except for the list to cascade
with the right data from the table...

HELP (and thanks :),
Oren
<snip - rest of thread>
If I've missed something else, (i.e. the default
value when there isn't one) you could hard code that value into the command
button something like this: (aircode)

Sub cmdWhatever_Click()
Dim MyVar

MyVar = Me.cboMyCombo

If Len(MyVar & vbNullString) = 0 Then
MyVar = ' The default value
Else
MyVar = MyVar
End If

' Rest of code

End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

<snip>
Jul 17 '05 #1
1 4757
Oren Kaplan wrote:

.....
> - And then when you click the Command you can refer to
> ComboBox`s value and call a Sub or Function using that value.
>
> Thing is... The ComboBox doesn`t display its DefaultValue at
> the begining ...
If you want to set the 'DefaultValue', (I am assuming the default is the
first value in the list):
Combo.Text = Combo.List(0)
> and when I move the mouse over a record it only
> 'selects' it, as in highlights it in black, and clicking on
> them doesn`t make any difference. In the end the text portion
> of the combobox is either empty as usual or full with some
> spaces...


As for the above - it is a little confusing as to what the problem is? Are
you describing a click on an item in the combobox that produces 'empty as
usual or full with some spaces'? If you are then you must have some code
that is interfering with the 'normal' function of the combobox. Check your
code for any events and references to the combobox in question. If you
can't figure out the problem you might want to post the code related to the
combobox.

Regards
Mike
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: david s | last post by:
I've got a combobox that I am getting updated data for in real time and need to clear out the values and reload it with the new data. I keep getting an error that I can't access the control...
1
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
7
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table...
5
by: Don | last post by:
I have a project wherein I derive a combobox and create a custom Populate() method for it to fill it with objects of a custom class I also created in a second project that the combobox project...
8
by: | last post by:
I am sure this has been asked and answered, but here goes anyway... VS.Net 2005, VB.Net How can you display more than one field in the displaymember property of a combobox inside the...
3
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Boy am I having trouble with this. Does anyone know here I can get a good example of using a combobox within a dataviewgrid? No matter what I do i get all kinds of errors. My grid is bound...
3
by: Paulers | last post by:
Hello all, I have been pulling my hair out trying to figure out how to access the selected text in a combobox from another thread. I can get it working with a textbox but it does not with a...
1
by: Man4ish | last post by:
Hi, How Eventlistner can be used with rendred combo box. I got one example of combobox in table as follows . /* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc. All rights reserved. * ...
1
by: kimic | last post by:
Hello, i am using WPF combobox in my application. 1) I create and add a combobox to a visual container (usualy Grid) by runtime or it is defined in the XAML page 2) I assign combobox source to the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.