Functional buttons F3,F4,F5

  • Thread starter Thread starter Zanetti via AccessMonster.com
  • Start date Start date
Z

Zanetti via AccessMonster.com

Hi all,
Uh i have e huge problem how can i do this! I need to make functional buttons
to do some operations like save ,delete,or print...Press functional button F3
or click on form button Print ....
I have buttons alredy and i have code on events on all this buttons.
I know the way with main modules too put all this code in modules and then to
do if is loaded some form do some event.
But it is to complicate and i dont have time to do and test all that.
Does somene know how can i do on some easy way .
 
How about attaching them to a macro and let the macro use the code(function)
you have created... Then from the button call the macro

hth
 
I do this on nice way but i have another problem now
Feature Key Prevew on form i set on Yes, then i use those procedure On Key
Down.
Code:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyEscape:
KeyCode = 0
DoCmd.Close
Case vbKeyTab:
KeyCode = 0
Case vbKeyF1:
KeyCode = 0
DoCmd.OpenForm "HelpPoruka"
Case vbKeyF2
KeyCode = 0
command1_Click
Case vbKeyF3
KeyCode = 0
command2_Click
Case vbKeyF5
KeyCode = 0
command3_Click
End Select
End Sub


Thats all works when focus is on this form.
When focus is on subform this code doesn work.I put same procedure on subform
but nothing!

Instead command2_Click i put forms!formname! command2_Click and nothing i
get run time erorr.
I cant tell him name of button..
Tnx
 
Zanetti via AccessMonster.com said:
I do this on nice way but i have another problem now
Feature Key Prevew on form i set on Yes, then i use those procedure On
Key
Down.
Code:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyEscape:
KeyCode = 0
DoCmd.Close
Case vbKeyTab:
KeyCode = 0
Case vbKeyF1:
KeyCode = 0
DoCmd.OpenForm "HelpPoruka"
Case vbKeyF2
KeyCode = 0
command1_Click
Case vbKeyF3
KeyCode = 0
command2_Click
Case vbKeyF5
KeyCode = 0
command3_Click
End Select
End Sub


Thats all works when focus is on this form.
When focus is on subform this code doesn work.I put same procedure on
subform
but nothing!

Instead command2_Click i put forms!formname! command2_Click and nothing
i
get run time erorr.
I cant tell him name of button..
Tnx

Another approach is to use a macro called "AutoKeys". In this Macro you can
define Function Keys or Ctrl+X (where X is a character) etc. Create a new
Macro, while editing you must enable "Macro Names" (it's the XYZ button on
the toolbar, or try your right mouse button). Then enter for example:

Macro Name Action
{F3} MyMacroForF3
{F4} MyMacroForF4
^R MyMacroForControl-R

You can also use a macro called "AutoExec" where you can put anything you
want to happen upon opening the database.

Good luck!
 
Back
Top