473,326 Members | 2,124 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,326 software developers and data experts.

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 programmatically 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 1954
On Jun 14, 1:26 am, John <brimjo...@gmail.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 programmatically 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
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...
17
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)...
2
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...
1
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...
4
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
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...
7
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...
3
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
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.