[AccessD] Clear Keyboard Buffer

Rocky Smolin rockysmolin2 at gmail.com
Tue May 11 09:09:01 CDT 2021


Jim:

I tried that but no cigar.  What I want is for the program NOT to process
any pending events from the keyboard.  When you say process, how does that
affect the program when the DoEvents is at the top of the Current event
module?

I may have found a workaround, though. Using the Access Navigation buttons
I have not been able to create this error regardless of how fact I hit the
next record navigation button.  I suspect that Access is not accepting any
more keystrokes until the next records fetched and loaded.

So now I'm wondering if there's a way I could disable the keyboard at the
top of the Current even and re-enable it before exiting the event code?

r
On Tue, May 11, 2021 at 5:07 AM Jim Dettman via AccessD <
accessd at databaseadvisors.com> wrote:

>
>  Should also be worth noting that DoEvents  will process all keyboard
> events.
>
> Jim.
>
> -----Original Message-----
> From: AccessD On Behalf Of jack drawbridge
> Sent: Tuesday, May 11, 2021 8:01 AM
> To: Access Developers discussion and problem solving
> <accessd at databaseadvisors.com>
> Subject: Re: [AccessD] Clear Keyboard Buffer
>
> Rocky,
> Here is an old thread that mentions clearing the keyboard buffer
> <
> https://www.mrexcel.com/board/threads/flushing-the-keyboard-buffer.254206/
> >
> .
> Know nothing other than I found it with Google. Hope it's helpful.
>
> On Mon, May 10, 2021 at 6:33 PM Rocky Smolin <rockysmolin2 at gmail.com>
> wrote:
>
> > Dear List(s):
> >
> > I have a form with a subform and I have two command buttons that do Next
> > Record and Previous Record.  No problem.
> >
> > Until someone tries to hit the Next Record or Previous Record real fast
> and
> > then I get an error about the subform not existing.
> >
> > It's a timing thing I'm sure. Might be the keyboard buffer overflowing.
> And
> > I'm thinking that one way to get around the problem (assuming there isn't
> a
> > right way to do this) is to clear the keyboard buffer on entering the
> > Current event where this is happening.
> >
> > But I can't find anything through Google about clearing the keyboard
> buffer
> > in VBA (2010).
> >
> > Is there a simple way to do this?
> >
> > MMTIA
> >
> > Rocky
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list