"Auto Repeat" feature on command buttons

J

John S. Ford, MD

I'm coding in Access 97. Because I needed to customize the way a particular
form navigates through records, I created and coded my own record navigation
buttons. This works fine except for one thing. I'd like them to behave the
same way the "real" navigation buttons work when the user keeps one of them
down: automatically repeating.

In the Acc97 help files, the Auto Repeat property of a command button is
described. It is specifically stated that despite setting it to "Yes", if
the event handler changes the current record, the Auto Repeat property has
no effect. Well, they weren't lying!

Is there any way to get around this?

John
 
A

Allen Browne

AutoRepeat does work, but as you found it does not work for a change of
record.

One workaround is to place the nav buttons in an unbound subform. Naturally
the code has to be changed so that it changes record in the main form, but
IIRC that allows the AutoRepeat to do its thing.
 
J

John S. Ford, MD

Allen,

Thanks for the idea. One question. I'm writing the code for the navigation
button sitting on my new subform. How do I make the DoCmd object operate on
the main form as in:

DoCmd.GoToRecord , , acNext

where I'm refering to the parent form that the subform is sitting on?

John
 
R

Rob Oldfield

You just need to specify the name of the form to use....in your case:

DoCmd.GoToRecord acDataForm, Parent.Name, acNext
 
S

Stephen Lebans

As Allen said, stick your CommandButtons on a SubForm. Sample code is
here:
http://www.lebans.com/recnavbuttons.htm
RecordNavigationButtons is an MDB containing code to replace the
standard Navigation Buttons. The custom buttons exactly emulate the
standard navigation bar including the autorepeat property.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
J

John S. Ford, MD

Thanks Rob. That was easy enough!

John
You just need to specify the name of the form to use....in your case:

DoCmd.GoToRecord acDataForm, Parent.Name, acNext
 
J

John S. Ford, MD

Stephen, I sure wish I'd been aware of your pre-coded record navigation
buttons before I started coding them myself! Yours look exactly like what
I'm looking for. Thanks,

John
 
Top