Avatar of hgj1357
hgj1357
 asked on

MS Access Send Keys {PGDN} alternative

So, I know I'm not supposed to use send keys, but I don't know how to do this any other way.  I now need to as the send keys {PGDN} does not work on my WIn 8 tablet.

I have a selection list "List1"

I want two big buttons for page up and page down as the guys in the field won't be able to use the little sliders to navigate up and down.

Is there an alternative to this:

Me.List1.setfocus
sendkeys "{PGDN}"

Thanks
Microsoft OfficeMicrosoft Access

Avatar of undefined
Last Comment
hgj1357

8/22/2022 - Mon
Kent Dyer

How about doing this programatically?

SELECT * FROM SOMETABLE WHERE column = "some_value"
hgj1357

ASKER
The list has >1,000 items in it, so this would be a laborious approach. ALthough I suppose we could go

Field1 = Me.ID
Me.ID = Field1 + 10
Field1 = Me.ID
ASKER CERTIFIED SOLUTION
IrogSinta

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
hgj1357

ASKER
I ended up using this. It works surprisingly well.

Dim MyList As Integer
MyList = Me.List1.ListIndex
MyList = MyList + 12
Me.List1.SetFocus
Me.List1.ListIndex = MyList

12 is the number of items shown in the list, i.e. one page.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
IrogSinta

Well, you really could shorten what you have to the following two lines:
Me.List1.SetFocus
Me.List1.ListIndex = MyList.ListIndex + 12

Open in new window

Or you could have used the single line I gave you earlier.  That way you wouldn't have needed to SetFocus to the listbox first:
Me.List1 = Me.List1.ItemData(Me.List1.ListIndex + 12)

Open in new window

In either case, you will still have the problems I pointed out earlier:
1. there would be a highlighted item when the button is pressed.
2. the scrollbar would still be visible and if that is used it would throw off the next visible section of the list.

Ron
hgj1357

ASKER
I can live with those issues.  I have bigger ones!!