Create record and enter static text in combo box with keyboard shortcut (1 Viewer)

gschimek

Registered User.
Local time
Today, 09:56
Joined
Oct 2, 2006
Messages
102
I have a question about keyboard shortcuts. I know you can create a keyboard shortcut by adding the & symbol in the text of a label, and then your alt key will do something in combination with the modifier.

Is there a way to create a keyboard shortcut that would move the cursor to a combobox in the New Entry record of a form (the bottom record by default where new records are added), and insert a static value into that combo box?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:56
Joined
Oct 29, 2018
Messages
21,358
Hi. The keyboard shortcut you mentioned is for a button you place on your form. So, if that's what you want, then just make the button do the work and assign the keyboard shortcut to it like you described. But, if you're talking about using a keyboard shortcut without using a button, then you can either look into using an Autokeys macro or check out the KeyPreview property of your form.
 

oleronesoftwares

Passionate Learner
Local time
Today, 07:56
Joined
Sep 22, 2014
Messages
1,159
You have to add the code to Form_Load() event, i mean referencing an ansi key
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 07:56
Joined
Oct 29, 2018
Messages
21,358
You have to add the code to Form_Load() event, i mean referencing an ansi key
Hmm, I'm not sure how putting code in the Load event of the Form will help trap a key stroke. Can you please elaborate? Thanks.
 

oleronesoftwares

Passionate Learner
Local time
Today, 07:56
Joined
Sep 22, 2014
Messages
1,159
Hi.
Apologies, for the wrong answer, i didn't read the requirements well before suggesting.

You can actually achieve it by using macros.

1. Create a macro that has two actions.
A. Go to record, New of the particular form that you want.


B. Set Value action.

Then name it Autokeys

The images i put does not include the set value action.
You can read more about the arguments for set value action in the link below



Take note of the way the macro name is, in the sample , the shortcut key that will trigger the macro is Ctrl and F1
 

Attachments

  • macro design.PNG
    macro design.PNG
    18.5 KB · Views: 252
  • macro name.PNG
    macro name.PNG
    15.6 KB · Views: 250

Users who are viewing this thread

Top Bottom