473,405 Members | 2,354 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,405 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 11620
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.