PC Review


Reply
Thread Tools Rate Thread

Cycle records - Mouse Wheel

 
 
Andy
Guest
Posts: n/a
 
      20th Oct 2008
I have a form which has a Go To New Record action on open event.

The form is based on a table so as the form is opened it goes to a new
record as expected. The form is set to cycle on current record only but if
you use the mouse wheel it is still possible to cycle to earlier records in
the table.

Is there a way to prevent this and stay on the new record?

Also - if someone starts to fill in some data for this new record but then
decides to cancel is there a neat way to stop any data being saved rather
than putting lots of code into the Close Form event.

Thanks for any suggestions.
 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      20th Oct 2008
Check out Stephen Lebans MouseHook at

http://www.lebans.com/mousewheelonoff.htm

With it you can disable the scroll.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"Andy" wrote:

> I have a form which has a Go To New Record action on open event.
>
> The form is based on a table so as the form is opened it goes to a new
> record as expected. The form is set to cycle on current record only but if
> you use the mouse wheel it is still possible to cycle to earlier records in
> the table.
>
> Is there a way to prevent this and stay on the new record?
>
> Also - if someone starts to fill in some data for this new record but then
> decides to cancel is there a neat way to stop any data being saved rather
> than putting lots of code into the Close Form event.
>
> Thanks for any suggestions.

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      20th Oct 2008
Does opening the form in DataEntry mode work? Set the form's Data Entry
property to Yes, or if you open the form programmatically use this kind of
thing:
DoCmd.OpenForm "Form1", DataMode:=acFormAdd

For the last part of your question, use the BeforeUpdate event of the form
to perform any checks you wish. You can cancel the event if you are not
happy.

Form_Close is too late (i.e. the record has already been saved at that
time.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Andy" <(E-Mail Removed)> wrote in message
news:88A8F3CC-A8A7-41A9-8843-(E-Mail Removed)...
>I have a form which has a Go To New Record action on open event.
>
> The form is based on a table so as the form is opened it goes to a new
> record as expected. The form is set to cycle on current record only but if
> you use the mouse wheel it is still possible to cycle to earlier records
> in
> the table.
>
> Is there a way to prevent this and stay on the new record?
>
> Also - if someone starts to fill in some data for this new record but then
> decides to cancel is there a neat way to stop any data being saved rather
> than putting lots of code into the Close Form event.
>
> Thanks for any suggestions.


 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      20th Oct 2008
Thanks - Excellent.

"Allen Browne" wrote:

> Does opening the form in DataEntry mode work? Set the form's Data Entry
> property to Yes, or if you open the form programmatically use this kind of
> thing:
> DoCmd.OpenForm "Form1", DataMode:=acFormAdd
>
> For the last part of your question, use the BeforeUpdate event of the form
> to perform any checks you wish. You can cancel the event if you are not
> happy.
>
> Form_Close is too late (i.e. the record has already been saved at that
> time.)
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Andy" <(E-Mail Removed)> wrote in message
> news:88A8F3CC-A8A7-41A9-8843-(E-Mail Removed)...
> >I have a form which has a Go To New Record action on open event.
> >
> > The form is based on a table so as the form is opened it goes to a new
> > record as expected. The form is set to cycle on current record only but if
> > you use the mouse wheel it is still possible to cycle to earlier records
> > in
> > the table.
> >
> > Is there a way to prevent this and stay on the new record?
> >
> > Also - if someone starts to fill in some data for this new record but then
> > decides to cancel is there a neat way to stop any data being saved rather
> > than putting lots of code into the Close Form event.
> >
> > Thanks for any suggestions.

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent Mouse Wheel from scrolling through records =?Utf-8?B?Um9k?= Microsoft Access Form Coding 4 7th Nov 2007 03:03 PM
Mouse Wheel and records =?Utf-8?B?VmFudGFzdGlj?= Microsoft Access Form Coding 1 2nd Sep 2007 08:14 AM
Wheel Mouse scrolls between Records =?Utf-8?B?R2VuZW1vcmU=?= Microsoft Access Forms 2 8th Nov 2006 10:34 PM
RE: Prevent scrolling through records with mouse wheel? =?Utf-8?B?T2ZlciBDb2hlbg==?= Microsoft Access Forms 0 16th Apr 2006 09:24 PM
Mouse wheel navigating through records =?Utf-8?B?RnJlZU1hc3Rlcg==?= Microsoft Access Forms 7 11th Aug 2004 11:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:18 AM.