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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendkeys click

Status
Not open for further replies.
Jan 10, 2004
12
US
How can I send a "click" via the sendkeys? what is the command?

 
Hi,

You mean to activate any command button click event?, call the routine directly. For example;

call cmdSave_Click()

Regards,

RADM
 
How would I specify the button click event if it occurs on a different form (the form is open)?

Thanks.
 
Can you select the object, and send the enter key? Seems like that would do it.
 
It reads like this.

Private Sub TxtgetCountOfPhoneMessages_Click()
On Error GoTo HandleErrors

Forms![Company]![ListTabs] = "Phone Messages"
cmdClick (ListTabs_Click)
' the ListTabs_Click() is the event I would like it to 'trigger.

ExitHere:
Exit Sub

HandleErrors:
Select Case Err.Number
Case Else
End Select
Resume ExitHere
 
Hai Charles,

I think if you can create one public function which will activate the click event of ListTabs. Then call that function from your main form.

Regards,

RADM
 
Hai Charles,

To clear my previous solution, just create a public function in the sub form and just call click event of command button.

For example; frmCompany is the name of your subform
frmMain is your main form.

add this to frmCompany

Public Function ActivateTabClick()
call ListTabs_Click
End Function

Then from frmMain, call from anywhere as follows

forms![frmMain].ActivateTabClick

I had a similar problem before and worked out in this way.

Regards,

RADM
 
This may be a silly question but where can i get the sendkeys.dll from?

I looked on my machine for it because i thought it was a dll which was included in windows. I did not find it.

Im developing a VB app in which i need to send password and username information to a dialog box.

Any help is greatly appreciated.
 
Hi,

You're right. There is no sendkeys.dll library file available and sendkeys is a function part of VBA. Anyway don't bother about that, please check your VBA help file to get more about Sendkeys.

To display username and password information on a dialog box, it is not a good idea to use sendkeys function. You can directly use text boxes with proper masking facility.

Regards,

RADM
 
Thanks for your previous response.

Actually, what im trying to do is automate the process of having to manually type my credentials for a pcAnywhere app.

So I figured that I could use sendkeys to send my credentials into the username and password fields. But I have also heard that sendkeys is somewhat unreliable.

Do you think that the Windows API might have some functionality that I could use to accomplish this task?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top