Solved

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

Posted on 2012-12-28
14
745 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

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
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)
Comment Utility
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
Comment Utility
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
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
I see ...
0
 
LVL 6

Author Comment

by:HomerTNachoCheese
Comment Utility
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)
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Author Comment

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

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
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
Comment Utility
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
Comment Utility
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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
Comment Utility
0
 
LVL 6

Accepted Solution

by:
HomerTNachoCheese earned 0 total points
Comment Utility
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
Comment Utility
I am having to abort this idea, however your responses were helpful.  Thanks.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now