SendKeys Problem...Help Welcomed!

mpaccess

New member
Local time
Today, 02:21
Joined
Jul 29, 2008
Messages
9
i have a macro assigned to a command button on a form to CancelEvent when clicked then close the form. the event being cancelled is a print preview of a report. it does close the form but then pops an "Enter Parameter Value" messagebox. i can escape out of this but it will not recognize SendKeys of {esc} following the CancelEvent. anyone know why it does not respond to the send keys? i do not want the user to see this message box and have to escape or click cancel.

Thanks!
 
In the macro try putting Yes in the Wait box at the bottom of the screen and also duplicate the action line, that is, run the SendKeys action twice and with Wait as Yes for both of them. I had to do that to a couple of mine, although they were not for Escape. But easy to try.
 
Thanks for the suggestion! I have tried repeating up to 4 times the SendKeys with the wait on, but no such luck. What other tricks do you have?

Thanks!
 
Vista will stop SendKeys but the latest version works, at least based on what I have. There is heaps on Google about SendKeys and Vista.

Also, try converting the macro to code, which will still have the Send Keys action. However, I have seen a couple of times where a macro would work and the code would not work and also where the code would work but the same in macro would not work but that was not with SendKeys. But you never know:D

However, just read your post again and the problem might be that the msg box is triggered before the SendKeys action runs and the msg box would stop it running.
 
thanks again! i have also tried to put the SendKeys prior to the CancelEvent with no joy. i'll see what i can do with code.

thanks!
 

Users who are viewing this thread

Back
Top Bottom