Sign in to follow this  
Followers 0
walkeraj

Friggin' Access!

2 posts in this topic

Okay, I'm writing a script to do database import and conversion in Access for a task that I have to do at least once a month. Because of the customized controls, I've accepted the fact that I have to do it entirely via Send(), however, the problem I'm having is that I can't seem to time it to send the keystrokes at the right time. The problem arises because access uses the window-within-window type of code. So, when you first run the program, the window is up AND active, but it's still loading the toolbars and windows and stuff. Further, this doesn't always take the same amount of time. If used recently, it may be up in two seconds. If not, it could take 10-15 seconds or more. This is fine for the initial keypresses (they just go into the buffer and the program proceeds to load the file like I told it). However, sometimes keypresses after that get lost, and I'm wondering if there isn't some technique I can use to ensure that I'm waiting until the program is up and idling before I slam all of that text at it.

-A

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Okay, I'm writing a script to do database import and conversion in Access for a task that I have to do at least once a month. Because of the customized controls, I've accepted the fact that I have to do it entirely via Send(), however, the problem I'm having is that I can't seem to time it to send the keystrokes at the right time. The problem arises because access uses the window-within-window type of code. So, when you first run the program, the window is up AND active, but it's still loading the toolbars and windows and stuff. Further, this doesn't always take the same amount of time. If used recently, it may be up in two seconds. If not, it could take 10-15 seconds or more. This is fine for the initial keypresses (they just go into the buffer and the program proceeds to load the file like I told it). However, sometimes keypresses after that get lost, and I'm wondering if there isn't some technique I can use to ensure that I'm waiting until the program is up and idling before I slam all of that text at it.

-A

Depending on how your using Access, you could use the Windows WaitForInputIdle call. It will wait for an application to become "idle", which means that the application is ready to accept user input. Here is the MSDN link if you're interested. Edited by PaulIA

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0