Hi to everyone in N.G.
I would like to known if there is a way to assign keyboard shortcuts,
like Ctrl+G or
Ctrl+F3, by VBA code?
This is my code:
-----------------------------------------------------------------------
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyTab Then
Screen.ActiveControl.Text = StrConv(Screen.ActiveControl.Text,
vbProperCase)
End If
End Sub
-------------------------------------------------------------------------
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
-------------------------------------------------------------------------
Insted of use vbKeyTab, I'd like to use Ctrl+G or any other key
cobination, to fire the code!
Is it possible? if not, how I have to change the above code?
I hope sameone will give to me an answer...
Thanks a lot,
Stefano.
Ken Snell (MVP) - 08 Sep 2007 13:52 GMT
Check out AutoKeys macro in Help file. Use that to "assign" that key
combination to a specific macro or VBA public function that you want to run
when you press that key combination.

Signature
Ken Snell
<MS ACCESS MVP>
> Hi to everyone in N.G.
> I would like to known if there is a way to assign keyboard shortcuts,
[quoted text clipped - 20 lines]
> Thanks a lot,
> Stefano.
Linq Adams - 08 Sep 2007 14:35 GMT
And if you're trying to simply change the data to proper case you're making
extra work for your users! The standard way to do this requires no
interaction from them!
Private Sub YourControlName_AfterUpdate()
Me.YourControlName = StrConv(Me.YourControlName, vbProperCase)
End Sub

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000
John W. Vinson - 09 Sep 2007 01:01 GMT
>Private Sub YourControlName_AfterUpdate()
> Me.YourControlName = StrConv(Me.YourControlName, vbProperCase)
>End Sub
Or (to prevent the code from undoing carefully constructed correct
capitalization):
If StrComp(Me.YourControlName, LCase(Me.YourControlName), 0) = 0 Then
Me.YourControlName = StrConv(Me.YourControlName, vbProperCase)
End If
John W. Vinson [MVP]