using sendkey functions

R

rudwan

hi
if i want to type something in the text box using code
is sndkey function help me
for example , i would lik eto type "rudwan" then go next
item
how i could use defined keyboard item within send key ?
 
S

suntisuka

Hi,

If textbox is the current control (ie, has focus), You can use textbox.text
= string. Otherwise, You can use textbox = string. To tab to next control,
You can use sendkeys "{TAB}". Or use textbox.setfocus, if you know exactly
its name.

HTH
Suntisuk
 
J

John Vinson

hi
if i want to type something in the text box using code
is sndkey function help me
for example , i would lik eto type "rudwan" then go next
item
how i could use defined keyboard item within send key ?

Sendkeys is full of bugs. For one thing, it will change the Num Lock
setting on your keyboard unpredictably; for another, it sends a single
keystroke, and does not read keystrokes. There is ALWAYS another way
to do anything within Access without using SendKeys! (this isn't
always true if you're running some *other* program from Access).

What you could do instead is use VBA code in the Form's Events. If you
really want to go to the next item by typing seven keystrokes
(rudwan<Enter> or rudwan<Tab>) rather than a single keystroke
(PageDown), you can certainly so so:

Private Sub txtMyTextbox_AfterUpdate)
If Me!txtMyTextbox = "rudwan" Then
DoCmd.GoToRecord acForm, Me.Name, acNextRecord
End If
End Sub


John W. Vinson[MVP]
 
R

rudwan

thanks for u both
may be i didnot explaine my question carefully
i would like to search inside of component of text box
if it find my creteria , i would like it to add space or
dash or dot or " = " or fullstop ... etc
 
J

John Vinson

thanks for u both
may be i didnot explaine my question carefully
i would like to search inside of component of text box
if it find my creteria , i would like it to add space or
dash or dot or " = " or fullstop ... etc

I do not understand, Rudwan.

Please explain with a specific, real-life example.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top