Move down a list box

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.
 
J

Jim Allensworth

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
 
J

Jim Allensworth

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
 
J

John Crighton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top