Solved

Use Sendkeys to type repetitive text

Posted on 2008-10-28
13
470 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
Comment Utility
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
Comment Utility
I have them set up in AutoKeys but Sendkeys doesn't send any keys!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
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
 

Author Comment

by:Pittsford
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now