473,503 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ListBox doesn't change focus with form navigation

How do you change what row is highlighted in a listbox (so that it
highlights the current record you are viewing in the form) when you
use the built-in navagation buttons (or any method other than the
listbox itself) to move between records in a form?

I have a data entry form (single form) with a list box that moves
the form to whatever record you click on in the list box. You can also
change the current record by the navagation buttons, and I want to
keep that feature available. (Both the list box row source and form
record source are set with the form OnOpen event to the forms
OpenArgs, chosen in a combo box on another form.)

When I change the current record by the navagation buttons, the
listbox still highlights the last record selected, not the current
one. This could lead to someone not realizing which record they are on
and editing or deleting the wrong record.

Any help is greatly appreciated.

Thanks,
~ Joshua Ammann
Nov 13 '05 #1
2 2340
"Joshua Ammann" <jo****@ammann.com> wrote in message
news:32**************************@posting.google.c om...
How do you change what row is highlighted in a listbox (so that it
highlights the current record you are viewing in the form) when you
use the built-in navagation buttons (or any method other than the
listbox itself) to move between records in a form?

I have a data entry form (single form) with a list box that moves
the form to whatever record you click on in the list box. You can also
change the current record by the navagation buttons, and I want to
keep that feature available. (Both the list box row source and form
record source are set with the form OnOpen event to the forms
OpenArgs, chosen in a combo box on another form.)

When I change the current record by the navagation buttons, the
listbox still highlights the last record selected, not the current
one. This could lead to someone not realizing which record they are on
and editing or deleting the wrong record.


In the Current event of the form set the value of the ListBox to agree with
the record.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
Well, that was so simple I feel pretty silly now for asking.
Thanks for answering, Rick!

~ JA

"Rick Brandt" <ri*********@hotmail.com> wrote in message news:<2j*************@uni-berlin.de>...
"Joshua Ammann" <jo****@ammann.com> wrote in message

<snipped>

In the Current event of the form set the value of the ListBox to agree with
the record.

Nov 13 '05 #3

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

Similar topics

3
2791
by: Andrew | last post by:
I'm having a major problem with a databound listbox in C#. In the constructor for the form I am trying to pre-select some of the items based in information in the database. When I step through the...
15
4642
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
1
6859
by: Keltus | last post by:
Hello, I have a Form with a ListBox in it. I'd like to be able to scroll the ListBox even when it's not in focus. ie. when i scroll the mousewheel when my focus is on the form, I'd like the...
9
45433
by: Alpha | last post by:
Hi, How can I set all the items in a listbox to be selected? I can't find a property or mehtod to do it so I thought I'll try using setselected method but I need to find out how many items are in...
2
3109
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I...
1
2740
by: Crazy Cat | last post by:
Hi, I have a form with a databound listbox and combobox. The listbox items are filtered based on the selection for the combobox. If I click on the listbox to select an item, I can no longer...
4
2783
by: Jeff | last post by:
....still new at this. ...hopefully a simple question Is there some practical way of altering the function of a keypress in Visual Web.net 2005 using VB without causing a postback on each...
5
4070
by: Matthew Wells | last post by:
I have a listbox set to simple multi select. For this example, users only select one item at a time. I have command buttons on the form for First, Previous, Next, Last, New (record). The form...
1
1423
by: colleen1980 | last post by:
Hi: I am trying to pull all the values from the listbox. But the ASP code shows only the last record. Needs help HTML <html> <head>
0
7201
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
7083
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
7278
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
7328
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...
1
6988
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
5578
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,...
0
4672
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...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.