Move down a list box

  • Thread starter Thread starter John Crighton
  • Start date Start date
J

John Crighton

Hi,

I have a display screen (e.g. users do not interact with it), and I need to
list the people present for the day.

I'm using a timer event to give PgDn sendkeys to the list box depending on
how many people are in, but an application on the computer keeps taking
focus from MS Access, possibly anti-virus or something. Anyway, it doesn't
disturb the look (e.g. doesn't pop up infront), however whatever's
interfering is obviously taking the sendkey commands as they stop working if
it's left (for example) overnight.

Is there a better way to move down a listbox, or to give Access focus?

Thanks in anticipation!

John C.
 
Hi,

I have a display screen (e.g. users do not interact with it), and I need to
list the people present for the day.

I'm using a timer event to give PgDn sendkeys to the list box depending on
how many people are in, but an application on the computer keeps taking
focus from MS Access, possibly anti-virus or something. Anyway, it doesn't
disturb the look (e.g. doesn't pop up infront), however whatever's
interfering is obviously taking the sendkey commands as they stop working if
it's left (for example) overnight.

Is there a better way to move down a listbox, or to give Access focus?

Thanks in anticipation!

John C.
Sendkeys can really be a problem. Best to avoid them.

How about using a subform instead of a listbox? It could be made to
look just like it. Then you could use record navigation techniques.

For instance if you want to page down 5 records then you could use
this in the timer event...

DoCmd.GoToRecord acDataForm, Me.Name, acGoTo, Me.CurrentRecord + 5

- Jim
 
Sendkeys can really be a problem. Best to avoid them.

How about using a subform instead of a listbox? It could be made to
look just like it. Then you could use record navigation techniques.

For instance if you want to page down 5 records then you could use
this in the timer event...

DoCmd.GoToRecord acDataForm, Me.Name, acGoTo, Me.CurrentRecord + 5
You would need to error trap for end of recordset (# 2105). Or for
this you could just use a On Error Resume Next statement at top of
code.

- Jim
 
You would need to error trap for end of recordset (# 2105). Or for
this you could just use a On Error Resume Next statement at top of
code.

- Jim

Excellent suggestion - thought hadn't entered my mind!

Thanks.

John C
 
Back
Top