Solved

MS Access Continuous Forms - Mouse Wheel 7 records at a time

Posted on 2012-12-28
14
828 Views
Last Modified: 2013-01-12
I have a payroll form that is set as continous forms in MS Access 2007.

When using the mouse wheel, the screen scrolls 1 record at a time (the current record still stays the same).

I would like to somehow program this form that when scrolling with the mouse wheel, the form scrolls 7 records at a time, as each employee has 7 records - one for each day of the week.  

The current record should still not change.  I do not want to move 7 records at a time, just scroll 7 records at a time.
0
Comment
Question by:HomerTNachoCheese
  • 7
  • 4
  • 3
14 Comments
 
LVL 75
ID: 38727966
Wouldn't that be a function of your mouse applet?  How many lines to scroll when you use the roller wheel?

Not aware of any way in VBA to control this.

mx
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38727986
What version of Access are you using?

In 2007, there is a Form_MouseWheel event in which you can add code.  There is also a Count argument available in the event to tell you how many records have already been scolled.

You could then use a recordset and the movePrevious, MoveNext methods to move to the appropriate record.
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
ID: 38728027
MX - I could possibly alter the mouse applet to get it to scroll 7 records, but then I would also be locking all payroll users into a setting that they may not want.
Fyed - I need the current record to not change.  MS Access 2007.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 75
ID: 38728034
I see ...
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
ID: 38728045
I don't think MS Access really cares what my mouse settings are with respect to wheel scrolling in the applet.  MS Access takes each scroll action as a single record move when in single form, and a single record scroll in continuous forms.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38728048
so, what you want to do is scroll the records in the continuous form, but not change the selected record?
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
ID: 38728049
It seems that each time MS Access detects one unit of wheel movement, it scrolls one record.  So, where to change the rule from 1=1 to 1=7.
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
ID: 38728051
fyed - yes.  This is the current behavior, but only one record at a time.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38728061
What do you want to do if scrolling the records up by 7 would hide the currently selected record?

Is this continuous form a subform or the main form?  I'm going to have to play with it a bit to see if I can get this to work.
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
ID: 38728092
The idea was to not fire off code for "OnCurrent" by changing records during the scroll.

However, I may have to rethink this as I am still having no luck with the Google searching.

Let me take a step back to explain why I want to do what I am doing, and perhaps moving records can be made to work and visually work out for the end user.

The payroll data entry screen has 100 or so employees, each with 7 records - Sunday through Saturday.  When scrolling around, I want the topmost record on the screen to be the complete 7 records for an employee and scroll 7 records at a time so that this is always the case.  

By using commands to move forward or backwards with movenext or moveprevious, the screen does not necessarily scroll until the offset number of records is actually off-screen.  So, the user could be scrolling and the screen does not move.

This may be a "no-solution" question.

Perhaps if I could figure out how to determine the number of records visible on the screen and determine where on the screen the selected record is at, I could calculate a set of moves to give the effect of moving one employee at a time.  I could end up making the database do odd things as a result depending on screen size, whether MS Access is maximized, etc.
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 250 total points
ID: 38728121
One method would be to include a listbox (or subform) that displays each employee.  Then, beside it, display only the 7 records for the selected week for the employee selected in the listbox or subform.  This way, you are not looking at 700 records at a time and will not be confused about which employees record is being worked on (which could happen easily if you are on the first or last record for an employee).
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 250 total points
ID: 38728133
0
 
LVL 6

Accepted Solution

by:
HomerTNachoCheese earned 0 total points
ID: 38728210
Still not what I am looking for, as the record changes.  

I may have to go that route, or just not program this at all.  

Will see what comes up after I get back Wednesday.  If nothing better, 250 points apiece.

Thanks for the help MX and Fyed!

If there is a SendKeys "{mouse x,y}" equivelant or some method to determine where the scroll bars are located, and simulate clicking them at those x,y coordinates, then that could be a viable alternate solution.  the x,y coordinates of the scroll up and scroll down buttons on the scroll bar are dynamic - they change from user to user based on the positioning of MS Access.  Unfortunately sending up and down arrow keystrokes, or page up/page down keystrokes still change the current record.  Tried even keyboard scroll locking with arrow keys.  Works in Excel, not Access.
0
 
LVL 6

Author Closing Comment

by:HomerTNachoCheese
ID: 38769724
I am having to abort this idea, however your responses were helpful.  Thanks.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question