473,606 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Annoying Listbox Quirk

Using Access 2007 I find that, on opening a form, a listbox control
always displays one of the values in the list, even if no value has
been selected. Thus, the first value in the list is displayed
(without highlighting) when the field has a null value. The user may
then change the displayed value by clicking on the up or down arrow to
the right of the control. This newly displayed value will also be
without highlighting and will be unselected. No value will actually
be selected until the user clicks on the displayed value or tabs
through the control while that value is displayed. I assume the lack
of highlighting is supposed to signal that the displayed value has not
been selected. However, my users don't know this and if the
unhighlighted value displayed in the list box happens to be the one
they want, they just save the record without ever clicking on or
tabbing through the listbox control. As a result, a null value is
stored in that field and the user is hopping mad that his "data entry"
didn't work.

I have worked around this by hooking a subroutine to the "On Save"
form event to check for a null value in the field referenced by the
listbox control. A message box tells the user he/she must click on
the value displayed in the listbox control to "select" the item they
think they have already chosen. This is pretty lame.

Ideally I should be able to programmaticall y check to see which item
is displayed (even if unselected) and, simply write that value to the
appropriate field when the record is saved without bothering the
user.

I can use the ItemData property of the listbox object to read the
values of the various items in the list, but I can't find any property
which tells me which of these values is currently being displayed.

Extensive Googling has been unsuccessful in yielding an answer. Any
suggestions would be appreciated.

John

Jun 14 '07 #1
1 1983
On Jun 14, 1:26 am, John <brimjo...@gmai l.comwrote:
Using Access 2007 I find that, on opening a form, a listbox control
always displays one of the values in the list, even if no value has
been selected. Thus, the first value in the list is displayed
(without highlighting) when the field has a null value. The user may
then change the displayed value by clicking on the up or down arrow to
the right of the control. This newly displayed value will also be
without highlighting and will be unselected. No value will actually
be selected until the user clicks on the displayed value or tabs
through the control while that value is displayed. I assume the lack
of highlighting is supposed to signal that the displayed value has not
been selected. However, my users don't know this and if the
unhighlighted value displayed in the list box happens to be the one
they want, they just save the record without ever clicking on or
tabbing through the listbox control. As a result, a null value is
stored in that field and the user is hopping mad that his "data entry"
didn't work.

I have worked around this by hooking a subroutine to the "On Save"
form event to check for a null value in the field referenced by the
listbox control. A message box tells the user he/she must click on
the value displayed in the listbox control to "select" the item they
think they have already chosen. This is pretty lame.

Ideally I should be able to programmaticall y check to see which item
is displayed (even if unselected) and, simply write that value to the
appropriate field when the record is saved without bothering the
user.

I can use the ItemData property of the listbox object to read the
values of the various items in the list, but I can't find any property
which tells me which of these values is currently being displayed.

Extensive Googling has been unsuccessful in yielding an answer. Any
suggestions would be appreciated.

John
Might be a .Focus issue. Call a fuction that takes Focus away from
the list boxes. Also there should be a property that allow you to
select nothing.

Jun 14 '07 #2

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

Similar topics

10
2315
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a similar name to the table. Rather than making a long Select Case that could become obsolete if lookup tables are added and the source table of the ListBox is edited I came up with this code.) This code works but of course it gives me build...
17
3101
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP) Me.lboxRP.SetSelected(newRPindex, True) When the last line executes, I get an error message:
2
5355
by: shaun roe | last post by:
As a follow up to my question about STL and bitset<64> I'd like to share a quirk (bug?) about unsigned long long support and the bitset. I'm using gcc 3.2 on linux or gcc 3.3 on mac, the answer is the same. unsigned long long int f; f=3; bitset<64> g(f); cout << f << endl; cout << g << endl; f<<=32;
1
1483
by: Peter Billam | last post by:
Greetings. This problem arises in the context of the CPAN module Crypt::Tea ... It works with IE, Mozilla, Netscape, Firefox, IE and Opera, but if you check out http://www.pjb.com.au/comp/test.html using Konqueror 5.0 (at least on linux) you will find: tea_code((2048299521,595110280), (-764348263,554905533,637549562,-283747546)) returns 1614127572, 339082849, should be -451692928, 1589210186,
4
4678
by: mux | last post by:
Hi I found out that the following piece of code throws an error. 1 #include "stdio.h" 2 3 int main() 4 { 5 int a,b; 6 a= 10;
6
2866
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
7
4526
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but ASP.Net stuff when I need a Windows Form control. I've seen dual listbox populators in countless Windows applications, and have seen them run very fast, so I figured this would be extremely popular. Here's how it should work:
3
2285
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
84
7170
by: braver | last post by:
Is there any trick to get rid of having to type the annoying, character-eating "self." prefix everywhere in a class? Sometimes I avoid OO just not to deal with its verbosity. In fact, I try to use Ruby anywhere speed is not crucial especially for @ prefix is better- looking than self. But things grow -- is there any metaprogramming tricks or whatnot we can throw on the self? Cheers,
0
8036
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7978
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8448
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8126
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6796
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5470
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.