Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to assign a keyboard function key to a form

Status
Not open for further replies.

crystalaid

IS-IT--Management
Jun 11, 2003
11
0
0
AU
Hi there,

We are using Paradox ver 10 and are a bit lost on the Object Pal stuff.
Bought a few books and we are struggling thru…. Paradox leaves Access for dead….. but we cannot find “how to” do some of the basic commands.

Could anyone please help with a problem ( one of many) we have?

At the moment we have a form, and in the form is a button, so we can go to the next record, and another button we can go to the previous record. What we would like to do is instead of using the mouse and clicking each of these buttons each time to go forward or backward thru the records, we would like to have an option to press a function key on the keyboard, to go to the next record. As an example we could press the button using the mouse to go to the next record or we could say press F12 to go to the next record.

We are lost on how to enter the code for the function key and still keep the mouse clicking option.

At the moment our code reads:-

method pushButton(var eventInfo Event)

active.action(DataFastForward)

endMethod

Is it possible to have a function key as well as the mouse click?

I’d appreciate any help you can give…. Tearing my hair out down here in Australia

Many thanks and best regards

Brad
Email brad@crystalaid.com


 
Brad,

ObjectPal can be a little daunting at first, and you will find that there are usually several way to do the same task. If you get stuck there's no need to pull out your hair, we're glad to help.

To add a function key you can add code to the "keyPhysical" method of the Form, the code should be under the "isPreFilter()" section. This way the code will be called for all objects on the form. The following code traps for the "F11" & "F12" keys, disables their default behavior and moves to the next or prior record. If you have a button with code and you want to have a function key depress the button you can replace the action with buttonName.pushButton().

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.isPreFilter() then
;// This code executes for each object on the form
switch
case eventinfo.vChar() = "VK_F11":
disableDefault
active.action(dataNextRecord)

case eventinfo.vChar() = "VK_F12":
disableDefault
active.action(dataPriorRecord)
endSwitch
else
;// This code executes only for the form
endIf

endMethod

I hope this helps, Lance who is a major contributor to this form has a great website it's packed full of tips and code examples, well worth checking out.

Perrin
 
Welcome. You came to the right place.

It seems like you are trying to reinvent the wheel. At least in Paradox 9 and earlier there are keyboard commands for navigation. Could you not just put F12 under the right arrow, etc.?

Harry
 
Hi Guys,

Very many thanks for your help.... really do appreciate it.

I'm off to try it right now.

Have a great day and thanks again

Very best regards
Brad......Australia
brad@crystalaid.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top