473,378 Members | 1,578 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,378 software developers and data experts.

SendKey Problems with Vista

JV
I am running a large Access 2000 application (installed using Access Runtime) that uses many VB SendKeys, primarily to expand combo boxes On Enter.

When trying to run it on Vista I get a "Permission denied" (error 70) error whenever entering a combo box. I have already changed the shortcut that starts access and opens the database to "Run as Administrator". I also changes msaccess.exe itself to "Run as Administrator".

I also tried using a macro to execute the SendKey action. It doesn't blow up, but neither does it expand the list.

Anyone else runn across this behavior? Any ideas how to correct it?

TIA,
John
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

Mar 8 '07 #1
7 7646

SendKeys is a problem in any version/OS.
If you can make design changes I would highly recommend replacing them
with something else.
For instance, a combobox has a Dropdown method that does the same
thing.

Mar 8 '07 #2
SendKeys should always, always, always be the tool of last resort! As
storrboy said, for the combo boxes dropdown use the combo box dropdown!

Private Sub YourComboBox_GotFocus()
YourComboBox.Dropdown
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

Mar 8 '07 #3
storrboy wrote:
SendKeys is a problem in any version/OS.
If you can make design changes I would highly recommend replacing them
with something else.
For instance, a combobox has a Dropdown method that does the same
thing.
I've used Sendkeys, not in many places, just where MS inhibits a person
from doing something except create a stupid kludge.

For example, there is no way to trap pressing the X button. MS stupidly
processes the BeforeUpdate event which I might want to cancel if the
validation doesn't pass. So MS presents a stupid error message if its
an error 2169 (can't remember what it is). You can use the Unload event
to cancel the close but only for an existing record. If you cancel at
the unload event on a new record, it leaves you with a blank record. I
would think that if I canceled the BeforeUpdate event, the X close event
(not trappable) would abort.

In a couple of places I wanted to remove what the op entered in a text
box in the BeforeUpdate event if it fails validation. I might have
something like
Cancel = True
Me.TextBox1.Undo
SendKeys "{Del}"
and it clears it out. I would think the Undo would clear the data
entered by the op but it doesn't.

I see NO REASON why the OS should stop someone from using Sendkeys.
Sure, there's security reasons. MS has gotten to the point one is
warned about using their own apps to open another of their apps...like
Outlook. For bypassing their security problems I use ClickYes written
by Sue Mosher. http://www.contextmagic.com/express-clickyes/. I wonder
if that too has been disabled.

If I write a program for XYZ Company I think the USER, not MS, should
determine the security. They should be able to tag the apps that are
trusted. So if I give someone a program, since it's not in the trusted
table, it will produce the MS sec warnings. The person tags it as
trusted. Then it doesn't produce the sec warnings. I see no reason for
creating certificates for someone I'm doing custom work for. That puts
the burden on the developer. Put it on the user.
Mar 9 '07 #4
>
If I write a program for XYZ Company I think the USER, not MS, should
determine the security. They should be able to tag the apps that are
trusted. So if I give someone a program, since it's not in the trusted
table, it will produce the MS sec warnings. The person tags it as
trusted. Then it doesn't produce the sec warnings. I see no reason for
creating certificates for someone I'm doing custom work for. That puts
the burden on the developer. Put it on the user.
Spot on.

I did just notice the same kind of behavior while testing my original
response. The KeyPress event seems to be ignored for (at least one of)
the arrow keys.
If KeyCode = vbKeyDown Then Me!Text0.Dropdown
works in the KeyDown event but,
If KeyAscii= vbKeyDown Then Me!Text0.Dropdown
does not work in the KeyPress event. It just moves to the next control
on the form.

I imagine there will be (are) cases where SendKeys is required, but
luckily I haven't had one, and I would still find away to avoid it
before relenting.

Mar 9 '07 #5
On 8 Mar 2007 14:22:02 -0800, "storrboy" <st******@sympatico.ca>
wrote:

That method is good, but better yet is to not change the behavior of
basic UI elements. Dropdowns don't dropdown on enter. Trying to make
it so, and YMMV.

-Tom.

>
SendKeys is a problem in any version/OS.
If you can make design changes I would highly recommend replacing them
with something else.
For instance, a combobox has a Dropdown method that does the same
thing.
Mar 9 '07 #6
salad <oi*@vinegar.comwrote in news:ni1Ih.10543$Jl.4566
@newsread3.news.pas.earthlink.net:
storrboy wrote:
>SendKeys is a problem in any version/OS.
If you can make design changes I would highly recommend replacing them
with something else.
For instance, a combobox has a Dropdown method that does the same
thing.
I've used Sendkeys, not in many places, just where MS inhibits a person
from doing something except create a stupid kludge.

For example, there is no way to trap pressing the X button.
Many of us have developed many Access applications since Access 2.0 without
ever using SendKeys. I am one.

Regardless of my long experience I try never to say, "There is no way
.....". I find that, "I have not found a way ...." is likely to be more
accurate.

Almost all of the complaints about not being able to do things with
Access/VBA/JET, and requests for special and unusual procedures that I see,
begin with, "I am in the swamp, having stumbled here without much thought
ot preparation, and I now need the genie of the Access bottle to deal with
the alligators." Sometimes there are genies; more often it's a better plan
to get out of the swamp.
Mar 9 '07 #7
On Thu, 08 Mar 2007 22:01:27 -0700, Tom van Stiphout <no*************@cox.netwrote:
>That method is good, but better yet is to not change the behavior of
basic UI elements. Dropdowns don't dropdown on enter. Trying to make
it so, and YMMV.

-Tom.
Yet one feels that Microsoft could easily decide to change this behaviour, as
they have with many aspects of the OS UI. Dropdown on hover is the way things
seem to be going.

Mar 10 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: baileystuff | last post by:
I have an issue where I have three Cases that SHOULD act the same but don't. If you look at the code below you will see that the general premise is to open a MSWord template and then use SendKey...
0
by: Gunawan | last post by:
Can someone help me how to write console application to sendkey c:>sendkey {ALT}+{TAB} simulate key ALT+TAB TIA Gun
13
by: Mark Rae | last post by:
Hi, On Friday I attended the Microsoft EVO conference in London where they talked about Vista, Office 2007 and Exchange 2007 and how they all work together beautifully, how they were all...
40
by: Spiros Bousbouras | last post by:
Do you have an example of an implementation where sizeof(short int) does not divide sizeof(int) or sizeof(int) does not divide sizeof(long int) or sizeof(long int) does not divide sizeof(long long...
19
by: =?Utf-8?B?TWlrZTk5MDA=?= | last post by:
When there is a shortcut of our app on the desctop, the app is not run until all the security in control panel of win vista is cleared. What to do to not have this problem. We do not want to tell...
7
by: =?Utf-8?B?RGF2aWRBdmlzb2Z0?= | last post by:
I support some legacy applications and use both VB6 and VB7 (.net) development environments on a Windows XP computer. The machine is due for replacement. The question is - can I install vb6 and...
1
by: wolvenlied | last post by:
I have recently come across a problem in Vista when trying to add it to a network. This is the first time I have had this problem and I haven't found anything relevant on google. I'll try my best to...
2
by: 13Rockes | last post by:
I am in the process of writing programs using VB6 in XP Pro. However, I am thinking about starting over using VB2005 as my company is migrating to Vista. Two questions... What kinds of...
8
by: Ross Culver | last post by:
I'm about to get a new computer for VS2K5 development. Is it ok to get Vista yet or should I stick with XP? Thanks, Ross
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.