PC Review


Reply
Thread Tools Rate Thread

SendKeys not working

 
 
=?Utf-8?B?ODAyMA==?=
Guest
Posts: n/a
 
      20th Feb 2007
I have some A2003 code that uses SendKeys to simulate the user pressing the
enter key {ENTER}. Works fine but, I find that the code will only run if the
user has Open Exclusive permission to the dbase. I know that SendKeys is not
a particularly good idea from a security perspective; I plan to rewrite the
code but, need a quick fix for now. Does A/Jet restrict their use unless in
Exclusive mode? Am I missing something? I would appreciate any help on this;
thanks in advance.
 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      20th Feb 2007
As far as I know, SendKeys is not restricted to only exclusive mode.

What you are attempting to accomplish using SendKeys could be restricted to
exclusive mode. Since you posted no details there is little anyone can do
to determine what you are attempting to do and why it fails.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"8020" <(E-Mail Removed)> wrote in message
news6135A89-0381-478B-AEE6-(E-Mail Removed)...
>I have some A2003 code that uses SendKeys to simulate the user pressing the
> enter key {ENTER}. Works fine but, I find that the code will only run if
> the
> user has Open Exclusive permission to the dbase. I know that SendKeys is
> not
> a particularly good idea from a security perspective; I plan to rewrite
> the
> code but, need a quick fix for now. Does A/Jet restrict their use unless
> in
> Exclusive mode? Am I missing something? I would appreciate any help on
> this;
> thanks in advance.



 
Reply With Quote
 
=?Utf-8?B?ODAyMA==?=
Guest
Posts: n/a
 
      21st Feb 2007
Hi, thanks for that. Here's the situation:
I have four separate pieces of code that run by the user clicking one of
four command buttons 1,2,3,4. The code has worked perfectly well for a long
time in a multi-user environment. The code in each simply opens a pop up
form with some default data. The user accepts the defaults by pressing enter
(they may very occasionally amend the defaults and then press enter). I
wanted to automatically run all four pieces of code in sequence so I created
a single command button and copied and pasted the four pieces of code into
the stub then did some quick pruning to remove unwanted End Subs etc. I
thought I could quickly solve the problem of eliminating the need to press
enter at the (4) pop-ups by using SendKeys at the appropriate point. It
works well enough but, only if the user has Exclusive permissions. Any
further comment would be appreciated.


"John Spencer" wrote:

> As far as I know, SendKeys is not restricted to only exclusive mode.
>
> What you are attempting to accomplish using SendKeys could be restricted to
> exclusive mode. Since you posted no details there is little anyone can do
> to determine what you are attempting to do and why it fails.
>
> --
> John Spencer
> Access MVP 2002-2005, 2007
> Center for Health Program Development and Management
> University of Maryland Baltimore County
> ..
>
> "8020" <(E-Mail Removed)> wrote in message
> news6135A89-0381-478B-AEE6-(E-Mail Removed)...
> >I have some A2003 code that uses SendKeys to simulate the user pressing the
> > enter key {ENTER}. Works fine but, I find that the code will only run if
> > the
> > user has Open Exclusive permission to the dbase. I know that SendKeys is
> > not
> > a particularly good idea from a security perspective; I plan to rewrite
> > the
> > code but, need a quick fix for now. Does A/Jet restrict their use unless
> > in
> > Exclusive mode? Am I missing something? I would appreciate any help on
> > this;
> > thanks in advance.

>
>
>

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      21st Feb 2007
From your description, I see no reason why this would work in exclusive mode
and fail otherwise.

Are you getting error messages?
Have you tried inserting a delay in the code after each send keys?

Personally, I would have written a routine that accomplishes the task
without opening the forms at all and avoids the use of sendkeys.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"8020" <(E-Mail Removed)> wrote in message
news:24C84B6B-56BF-4984-BF70-(E-Mail Removed)...
> Hi, thanks for that. Here's the situation:
> I have four separate pieces of code that run by the user clicking one of
> four command buttons 1,2,3,4. The code has worked perfectly well for a
> long
> time in a multi-user environment. The code in each simply opens a pop up
> form with some default data. The user accepts the defaults by pressing
> enter
> (they may very occasionally amend the defaults and then press enter). I
> wanted to automatically run all four pieces of code in sequence so I
> created
> a single command button and copied and pasted the four pieces of code into
> the stub then did some quick pruning to remove unwanted End Subs etc. I
> thought I could quickly solve the problem of eliminating the need to press
> enter at the (4) pop-ups by using SendKeys at the appropriate point. It
> works well enough but, only if the user has Exclusive permissions. Any
> further comment would be appreciated.
>
>
> "John Spencer" wrote:
>
>> As far as I know, SendKeys is not restricted to only exclusive mode.
>>
>> What you are attempting to accomplish using SendKeys could be restricted
>> to
>> exclusive mode. Since you posted no details there is little anyone can
>> do
>> to determine what you are attempting to do and why it fails.
>>
>> --
>> John Spencer
>> Access MVP 2002-2005, 2007
>> Center for Health Program Development and Management
>> University of Maryland Baltimore County
>> ..
>>
>> "8020" <(E-Mail Removed)> wrote in message
>> news6135A89-0381-478B-AEE6-(E-Mail Removed)...
>> >I have some A2003 code that uses SendKeys to simulate the user pressing
>> >the
>> > enter key {ENTER}. Works fine but, I find that the code will only run
>> > if
>> > the
>> > user has Open Exclusive permission to the dbase. I know that SendKeys
>> > is
>> > not
>> > a particularly good idea from a security perspective; I plan to rewrite
>> > the
>> > code but, need a quick fix for now. Does A/Jet restrict their use
>> > unless
>> > in
>> > Exclusive mode? Am I missing something? I would appreciate any help on
>> > this;
>> > thanks in advance.

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?ODAyMA==?=
Guest
Posts: n/a
 
      22nd Feb 2007
Yes, I always planned to re-write the code but, was looking for quick
work-around until I could get to it; looks like I'll have to do it sooner
rather than later. No error messages. I'll try the delay after SendKeys;
hadn't thought of that. If that does not fix it I'll go straight for Plan B
(re-write the code). Thanks for your input; much appreciated.

"John Spencer" wrote:

> From your description, I see no reason why this would work in exclusive mode
> and fail otherwise.
>
> Are you getting error messages?
> Have you tried inserting a delay in the code after each send keys?
>
> Personally, I would have written a routine that accomplishes the task
> without opening the forms at all and avoids the use of sendkeys.
>
> --
> John Spencer
> Access MVP 2002-2005, 2007
> Center for Health Program Development and Management
> University of Maryland Baltimore County
> ..
>
> "8020" <(E-Mail Removed)> wrote in message
> news:24C84B6B-56BF-4984-BF70-(E-Mail Removed)...
> > Hi, thanks for that. Here's the situation:
> > I have four separate pieces of code that run by the user clicking one of
> > four command buttons 1,2,3,4. The code has worked perfectly well for a
> > long
> > time in a multi-user environment. The code in each simply opens a pop up
> > form with some default data. The user accepts the defaults by pressing
> > enter
> > (they may very occasionally amend the defaults and then press enter). I
> > wanted to automatically run all four pieces of code in sequence so I
> > created
> > a single command button and copied and pasted the four pieces of code into
> > the stub then did some quick pruning to remove unwanted End Subs etc. I
> > thought I could quickly solve the problem of eliminating the need to press
> > enter at the (4) pop-ups by using SendKeys at the appropriate point. It
> > works well enough but, only if the user has Exclusive permissions. Any
> > further comment would be appreciated.
> >
> >
> > "John Spencer" wrote:
> >
> >> As far as I know, SendKeys is not restricted to only exclusive mode.
> >>
> >> What you are attempting to accomplish using SendKeys could be restricted
> >> to
> >> exclusive mode. Since you posted no details there is little anyone can
> >> do
> >> to determine what you are attempting to do and why it fails.
> >>
> >> --
> >> John Spencer
> >> Access MVP 2002-2005, 2007
> >> Center for Health Program Development and Management
> >> University of Maryland Baltimore County
> >> ..
> >>
> >> "8020" <(E-Mail Removed)> wrote in message
> >> news6135A89-0381-478B-AEE6-(E-Mail Removed)...
> >> >I have some A2003 code that uses SendKeys to simulate the user pressing
> >> >the
> >> > enter key {ENTER}. Works fine but, I find that the code will only run
> >> > if
> >> > the
> >> > user has Open Exclusive permission to the dbase. I know that SendKeys
> >> > is
> >> > not
> >> > a particularly good idea from a security perspective; I plan to rewrite
> >> > the
> >> > code but, need a quick fix for now. Does A/Jet restrict their use
> >> > unless
> >> > in
> >> > Exclusive mode? Am I missing something? I would appreciate any help on
> >> > this;
> >> > thanks in advance.
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sendkeys not working Davidx Microsoft Access Form Coding 2 2nd Jan 2010 12:09 PM
SendKeys not working for some program Oshikawa Microsoft Excel Programming 0 28th Apr 2009 09:19 PM
Sendkeys not working in 2007 Sarah Microsoft Access Macros 0 28th Aug 2008 05:58 PM
Sendkeys not working =?Utf-8?B?SG9sbHk=?= Microsoft Access Form Coding 3 6th Feb 2006 11:08 PM
SendKeys {HOME} not working RB Smissaert Microsoft Excel Programming 9 11th Dec 2003 02:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:52 PM.