473,326 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

sendkeys to another application

1
I would like use access to update another application by using the sendkeys method.

What I'm looking for is how to set the focus to the other application window and then use sendkeys to type in the account number and update the account with new information that will be stored in the access table.

Can anyone help me get started with the correct code? I've done this before but its been like 5 - 6 years and are totally drawing a blank.
Oct 27 '08 #1
1 11599
ADezii
8,834 Expert 8TB
I would like use access to update another application by using the sendkeys method.

What I'm looking for is how to set the focus to the other application window and then use sendkeys to type in the account number and update the account with new information that will be stored in the access table.

Can anyone help me get started with the correct code? I've done this before but its been like 5 - 6 years and are totally drawing a blank.
The following code should point you in the right direction and will:
  1. Open Notepad
  2. Type the text George W. Bush into the Window
  3. Close Notepad
  4. At the Save prompt, click on Yes
  5. Save the Filename as George W. Bush (.txt will automatically be added)
  6. Click on the Save Button

Expand|Select|Wrap|Line Numbers
  1. Dim retVal As Variant
  2.  
  3. retVal = Shell("Notepad", vbNormalFocus)    'Run Notepad
  4.  
  5. SendKeys "George W. Bush"           'Type George W. Bush in Notepad Window
  6.  
  7. SendKeys "%{F4}", True              'Send ALT+F4 to close Notepad
  8.  
  9. SendKeys "{ENTER}", True            'Yes at the Save Prompt
  10.  
  11. SendKeys "George W. Bush", True     'Type Filename to Save Document to
  12.  
  13. SendKeys "%S"                       'Activates the Save Button
  14.  
Oct 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mr. Bungle | last post by:
I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results) Private Sub...
2
by: RBohannon | last post by:
I need to create a report in MS Word populated with data from A2K. I have been asked to create the report in Word so that parts of it can be edited as necessary later. The data in the report are...
5
by: Wayne Gibson | last post by:
Hi, Was wondering if somebody could help.. I'm trying to use Sendkeys on a Windows forms. I have entered the following command to simulate a CTRL+ALT+1.. ...
1
by: Bryan | last post by:
I am writing a C# Windows App that updates out Excel reports' modules. The app is complete, but has a problem. The only way MS allows you to unprotect the VBA code in Excel is to do it by hand or...
2
by: David Kanter | last post by:
Hi, I am relatively inexperienced with VB.Net, but I am familiar with many concepts from programming; I have some basic level of competence with C/C++ and Perl, but I just started using VB this...
4
by: atr2000 | last post by:
How can I perform a SendKeys.Send to the current active application from a windows service? Or is there a different way to do this? I currently receive the following error message: ...
4
by: davermcl | last post by:
Hi, I'm experiencing a problem when using the VB SendKeys method. I'm sending characters to a textbox in another application. It works fine when the Windows Input Languages on both apps are...
5
by: =?Utf-8?B?U3JpbWFu?= | last post by:
Hi, We are launching .net window from vb6 form. In .net form tabbing(tab out from one control to another control) was not working. for that i have written a code like Sendkeys.send("{TAB}") in the...
0
by: jairathore | last post by:
Hi, I m working on a project on which my requirment is like that remotely i control another application by using sendkey.sendwait method, i m sending some keystroke to that application and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.