Solved

Use Sendkeys to type repetitive text

Posted on 2008-10-28
13
480 Views
Last Modified: 2013-11-27
We used SendKeys extensively in Access97 databases for repetitive text entry.  Having upgraded to Access2000 - SendKeys no longer works.  I have read the Q & A here about avoiding the function but I believe most of the cautions don't apply for how we want to use it.  I have tried to use "Replacement for SendKeys" by Dev Ashish but can't get it work for how we want to use it. Can anyone offer a solution?

Here is the gist of what we would like... We frequently enter repetitive text into a field directly in a table and sometimes using a form.  We used to be able to press a keystroke combination (Macro name ^A   or ^P or  ^R   etc.) that then just "autotyped" the text into the field the cursor was in when the key combination was pressed.  For example, Pressing ^P would put "Pittsford, N.Y. 14534-1999" into the field. Pressing ^R would put "Rochester, NY 14620-" into the field and wait for the user to type the last 4 digits.  These (along with 8 other, much longer, text entries) saved the user a lot of time and helped to prevent typos.  

We can't use "Ctrl" ' because it is not always the row directly above that is being repeated.  Does anyone know another way to do this?  Does anyone know how to get sendkeys to work for this seemingly simple situation?  We don't want to access menus or dropdowns or switch fields or views or anythiing other than typing in repetitive text.
Thanks.
0
Comment
Question by:Pittsford
  • 6
  • 5
13 Comments
 
LVL 84
ID: 22827323
If I'm not mistaken, you can use a macro named "Autokeys" with your keyboard shortcuts.

The warnings against SendKeys are relevant IF your application is dependent on exactly what is typed, and where it is typed. If you're simply 'auto-entering' text, then you should be okay.
0
 

Author Comment

by:Pittsford
ID: 22827390
I have them set up in AutoKeys but Sendkeys doesn't send any keys!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22828649
Pittsford,

I use the same few sendkeys macros in Access 97 through 2007, and they all work fine.
Can you post all the details about one of these macors?

If it were me, I would simply load the most common addresses in a table and make that the source for a dropdown box.
This would make it easier to edit, sort, filter, disply, and maintain the entries directly, (these things are difficult if not impossile to do with Sendkeys macros)

I know you said that you don't want to us them, but you have not given a solid reason why they are a "nightmare" and sendkeys is "Better" (even though it is not working)
Comboboxes are made for this sort of thing, and 99% of Access databases use them without any complaints of losses in productivity.

JeffCoachman

0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:Pittsford
ID: 22832665
Jeff,
I'm sorry to be unclear but I don't think I said anything was a "nightmare" or that Sendkeys was "better" than anything else.  It's just what we have become accustomed to them and would like to find a way to continue to use them if possible.  

I believe there would be extra steps (mouse and arrow keys or whatever) involved in using a "dropdown box"; besides the fact that I don't know how to set that up.  Remember., I am a beginner.  

In Access97, we entered text directly into a table (usually not through a form, but sometimes) and not in a join query or anything - just directly into the table.  When the user was in a field, for instance the csz (city state zip) field or the Notes field, they could simply press a combination of two keys (Ctrl + P or Ctrl + R or Ctrl + U etc.) without their hands leaving the keyboard to use a mouse to access dropdowns.

I'm not sure what you meant by "post all the details" so I have attached an Access97 mdb file that has the Autokeys macros and one table in it.  When you open the table and look in the Notes field, you will see where we use a number of the automated text entry Sendkeys.  I hope that supplies the information you need.  
db1.mdb
0
 

Author Comment

by:Pittsford
ID: 22832752
Oh - By the way, I just allowed Access to convert this Access97 database to Access2000 and tried the macros - they do not work.  However, if I open it with Access97 - they work just fine.

Jeff said he "uses the same few sendkeys macros in Access 97 through 2007, and they all work fine" so maybe my installation of Access 2000 is bad?  Help / About lists it as Access 2000 (9.0.6926 SP-3) and while we are on a Novell server at work, I have taken the mdb file home - and the macros don't work there either.  I have a friend who has Access 2003 and I will email it to him to see if they will work there.  I am afraid, though, that it is a functionality that is lost after Access 97.  
0
 

Author Comment

by:Pittsford
ID: 22833378
OK - I sent them to my friend who has Access2003 and they work perfectly there. So - It's either an Access 2000 issue in general or a bad installation. IF it's a bad installation - then it's bad on all six machines that the staff use. That seems odd. Maybe there is an "add-in" that didn't get installed when the app was put on those machines?  Anyone have ideas?  Did anyone out there try the mdb file on THEIR Access 2000 machine?  Can they get them to work?  That might help determine if it's an installation / add-in issues.  If so, I've got the same "bad" or "featureless" installation at home.  Bummer.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 22833935
Reinstall Access 2000 making *SURE* that you do a FULL install
(Select the top level item and then select "Run All form my computer"
0
 

Author Comment

by:Pittsford
ID: 22836088
OK - This seems to be the issue...We have Access 97 AND Access 2000 installed on these machines because some of the databases haven't been converted yet.  So, I removed Access 97 from one of the machines and tried to run the autokeys macros (SendKeys)  I then got THIS error message...The Microsoft Access Utility add-in is missing or was modified. Rerun Microsoft Access or Microsoft Office Setup to reinstall Microsoft Access and the Microsoft Access Utility add-in.
So I Googled for that error and I found a reference (Article ID : 179695 ) to a "Utility.mda" file.  I did a search on a machine that still had the two versions of Access on it and found TWO of the utility.mda files.  So I renamed the one in the Access 97 folder and NOW the Sendkeys macros work --  In Access 2000 but NOT anymore in Access 97!  Guess I can't have the best of both worlds so I'll have to work faster at converting the old databases!  Thanks for the help Jeff.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22837478

If you say:
   "This seems to be the issue"
...Then this would indicate that my post helped resolve the issue.
So why are you requesting that the only accepted solution be "Your" post?

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22838594
I thought it said the asker was accepting their own post?
I must have mis-read it.
(Or you guys are playng tricks on me)
;-)

Sorry for the confusion.

Jeff
0
 

Author Comment

by:Pittsford
ID: 22842437
Well, TECHNICALLY, I did NOT use Jeff's solution, which was to reinstall Access 2000.  However, I awarded him the points anyway.  I am adding this comment for anyone else who searches for resolutions to an issue with Sendkeys to let them know that I DID NOT need ro reinstall Access as Jeff suggested - I just had to remove the old Utility.mda file.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22843112
Fair enough.

Thanks for the clarification.

I think I read your "request for Delete" reason wrong.
...my fault

If you want to change this to accept your own post, it is fine with me.
;-)

Jeff
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question