Mouse scroll and Combo box...

N

NWO

Hello.

I have a situation where when I select an employee record from my combo box,
the associated fields appear OK, but when I scroll up or down using the mouse
scroll wheel, all of the fields change to other records but the drop down
value in the combo box remains constant. How is this fixed?

Thank you.

NWO :)
 
N

NWO

I checked out the site. Nice, but to complex. We can't load external
drivers, progrAMS, or any other software onto our machines. Is there another
way that the Combo box can keep the same focus as the related fields on the
form, so that when a user uses the scroll button the fields (to include the
value in the combo box) are in sync from record to record?

NWO :)
 
R

Rob Parker

Sounds like you're wanting the combo-box to serve "double-duty" - select the
record to be displayed, and display the record which is selected. If that's
the case, then you'll need to set things up very carefully, because the
standard scenario would go like this:

Select item in the unbound (I presume it is unbound?) combo-box
AfterUpdate of combo-box finds selected record in form
Current event of form updates display in combo-box
AfterUpdate of combo-box finds selected record in form
Current event of form updates display in combo-box
...
(form goes "flickery" and application grinds to a halt until circular
loop times out or something)

Since you'll need the form's Current event to update the combo-box, you'll
have to use some other way of using the combo-box selection to find the
record. Probably simplest would be to add a command button which the user
clicks to find the selected record, which would allow the find code to be
moved to the button's Click event, with nothing in the combo-box's
AfterUpdate event. Unfortunately, this makes the user interface a bit more
complicated, since the mere act of selecting an entry in the combo-box
doesn't find that record immediately - the user has to do something else.
That's the price of the "double-duty" combo-box ;-)

HTH,

Rob
 
N

NWO

Excellent informed answer. I'm just gpiong to leave as is then because the
combo box works as designed at least to select the desired record. Just have
to train user group to be aware not to use the scroll feature of the mouse.
Even if the user does use the scroll feature, the name field directly under
the combo box will serve as verification that the user is on the intended
name.

Thanks Rob.

NWO :)
 
R

Rob Parker

You're welcome.

But see some additional comments in-line below:

Rob

NWO said:
Excellent informed answer. I'm just gpiong to leave as is then because the
combo box works as designed at least to select the desired record. Just have
to train user group to be aware not to use the scroll feature of the
mouse.

The scroll feature is useful if you are using a continuous form, but it can
be a real trap if you're displaying records in a single form - the user can
inadvertantly change a record without being aware of it, and then change
data for the wrong record. For this reason, using Stephen Lebans mouseoff
system is highly recommended!!! I've seen your other post where you say you
can't use it - that's a pity, it's worth its weight in gold.
Even if the user does use the scroll feature, the name field directly under
the combo box will serve as verification that the user is on the intended
name.

Having the name field directly under the combo-box may serve as
verification, but I wouldn't rely on it - users will focus on what they're
doing, not on every detail on-screen. I'm assuming that the combo-box is
unbound, and in the form header. You don't say whether you're displaying
records in single or continuous mode. If it's continuous mode, then it
should be obvious to the user which record they are working on (ie. which is
the selected record); if they perform any action or click in another row,
the selected record will not be the one displayed in the combo-box, but they
will know which record it is. However, if you're displaying single records,
then any click or action in the detail section of the form will change the
selected record without the user being aware of it, unless they happen to
notice that the name and the combo-box fields are now different - and, as I
implied earlier, that may not occur. If that's your situation, and you
can't disable the scrol wheel, then you could have a problem. Here's a
suggestion which may help in this situation:

Add a label (or an unbound textbox) to the form header (I'd put it
immediately below the combo-box), set it to display a suitable warning
message (eg. "The active record is NOT the one selected above"), and set its
visual properties to make it obvious (eg. red text, bold, ...). In the
form's Current event, set the new control to be visible if the selected
record does not match the selection in the combo-box. For example, if the
field you are using to move to the record selected in the combo-box is
StaffID, in the Current event you would add a line such as:
lblWarning.visible = Not(Me.StaffID = cboxMySelectComboName)

This will display the warning message when then user changes to a different
record from the one initially selected in the combo-box. You could use this
even if you're displaying in continuous mode, but there it's less important
(as discussed above).

Again, HTH,

Rob
 
N

NWO

Thank you again Rob.

I will use the Warning part of your response ASAP - this will work for us,
excellent work-around.

BTW, regarding the MouseHook deal, how do you handle the DLL when your using
the MDB on a network with several different client machines accessing the DB
(due to small size of my DB, DB is not split, but may consider doing so in
the future). Does each client have to have the DLL loaded on their machines?

Again, thank you very much.

NWO :)
 
K

Ken Snell [MVP]

Yes, the DLL file goes on each client's PC where a copy of the front end is
kept. FYI... Stephen's mouse wheel solution does not require the
installation of any software on the computers, nor does it require the
registration of the DLL file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top