Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 998
  • Last Modified:

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

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
HomerTNachoCheese
Asked:
HomerTNachoCheese
  • 7
  • 4
  • 3
3 Solutions
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
Dale FyeCommented:
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
 
HomerTNachoCheeseAuthor Commented:
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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I see ...
0
 
HomerTNachoCheeseAuthor Commented:
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
 
Dale FyeCommented:
so, what you want to do is scroll the records in the continuous form, but not change the selected record?
0
 
HomerTNachoCheeseAuthor Commented:
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
 
HomerTNachoCheeseAuthor Commented:
fyed - yes.  This is the current behavior, but only one record at a time.
0
 
Dale FyeCommented:
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
 
HomerTNachoCheeseAuthor Commented:
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
 
Dale FyeCommented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
0
 
HomerTNachoCheeseAuthor Commented:
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
 
HomerTNachoCheeseAuthor Commented:
I am having to abort this idea, however your responses were helpful.  Thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 7
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now