SendKeys requiring "utility"

N

NES

I want a sub form which is a continuous form to open with the focus on a
"new" record. So I created a macro consisting of SendKeys {^PDGN} (in proper
format).

I entered this in the properties of the sub form in the "On Open" selection.

The first time it runs I get the following error message message:

"The SendKeys action requires the Clinic Volunteer Database Utility Add-in
to be loaded. Rerun Clinic Volunteer Database or Microsoft Office Setup to
reinstall Cliinic Volunteer Database and the Clinic Volunteer Database
Utility Add-in."

Huh? There's not a lot of info relative to my needs out there. But I find
nothing on this at all. Needless to say, the macro doesn't work.

I would be most appreciative if someone could lend a hand with this. Thanks
in advance for any help you may offer.
 
R

Rick Brandt

NES said:
I want a sub form which is a continuous form to open with the focus
on a "new" record. So I created a macro consisting of SendKeys
{^PDGN} (in proper format).

I entered this in the properties of the sub form in the "On Open"
selection.

The first time it runs I get the following error message message:

"The SendKeys action requires the Clinic Volunteer Database Utility
Add-in to be loaded. Rerun Clinic Volunteer Database or Microsoft
Office Setup to reinstall Cliinic Volunteer Database and the Clinic
Volunteer Database Utility Add-in."

Huh? There's not a lot of info relative to my needs out there. But I
find nothing on this at all. Needless to say, the macro doesn't work.

I would be most appreciative if someone could lend a hand with this.
Thanks in advance for any help you may offer.

Never use SendKeys. Instead use either...

DoCmd.RunCommand acCmdRecordsGoToNew
or
DoCmd.GoToRecord acDataForm, "FormName", acNewRec
 
N

NES

Rick, thank you very much for the reply. That was fast. <s>

Unfortunately, I don't have the time to take a course in VBA. It's on my To
Do list if this decrepit old programmer lives that long. (I'm more
accustomed to the outdated QB 4.5).

That's why I rely upon Macros to do the simple things. I've used SendKeys in
other databases written in Access 97 and they transferred well to Access
2003. But I've never used them in 2003 per se. While I understand the code
you have written, there's the rest of it that I don't know how to implement.

Thanks very much for your suggestions. <s>
 
R

Rick Brandt

NES said:
Rick, thank you very much for the reply. That was fast. <s>

Unfortunately, I don't have the time to take a course in VBA. It's on
my To Do list if this decrepit old programmer lives that long. (I'm
more accustomed to the outdated QB 4.5).

That's why I rely upon Macros to do the simple things. I've used
SendKeys in other databases written in Access 97 and they transferred
well to Access 2003. But I've never used them in 2003 per se. While
I understand the code you have written, there's the rest of it that I
don't know how to implement.

Thanks very much for your suggestions. <s>

If you take note of both of my suggestions you will see that they start with
"DoCmd". That should mean that they both can be run as macro commands. There
is (almost) nothing that SendKeys can be used for which there isn't a better
solution.
 
N

NES

Well now. I guess that's why you're an MVP. <s>

Thank you very very much for that information. I was not aware of that. I
shall implement it posthaste.

Thanks again.
 
N

NES

Rick, I just tried it, and it works beautifully. Thank you so much for the
headsup on the use of procedures. What a find this is.

Thank you.
 
L

Linq Adams via AccessMonster.com

You really should bite the bullet and start to dabble in VBA! Macros are very
limited in what they can do and offer nothing in the way of error handling!

QB 4.5 was the engine Microsoft built Visual Basic around, and VBA was built
from VB. If you have any real experience in QB 4.5, you already know a good
50-60% of VBA code! And the new stuff is frequently simply improvements that
do things you used to have to write your own functions to do!

From your form's Design View, accomplishing your task would have required:

Pressing <Control> + G

Pasting this code in the code module that appeared

Private Sub Form_Load()
DoCmd.RunCommand acCmdRecordsGoToNew
End Sub

Clicking on the Access "Key" icon on the toolbar.

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

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
N

NES

Yes, I've done extensive programming in QB 4.5. Some commercial, and one for
home tracking of Blood Glucose levels including graphics for diabetics. A
Google search on my name and location will probably bring up references to
that old war horse from CompuServe.

Programming is addictive. I had purchased a book that took me far into the
depths of what that language could do. Microsoft's own manual didn't begin to
cover the power QB had.

May I ask the significance of Ctrl + G? I tried it, and it opened as you
stated, showing the code I had installed. I had gotten there a different way.
But the key combo didn't open to a NEW routine as I had expected, just to the
one I had entered.

The question is, what is the significance of "G"?

Thanks for your reply.
 
D

David W. Fenton

You really should bite the bullet and start to dabble in VBA!
Macros are very limited in what they can do and offer nothing in
the way of error handling!

While I agree with the sentiment, is it not the case that A2K7
macros are a different animal? Don't they now have some sort of
error recovery? And are they not substantially more powerful than
they used to be, in order that more than simple apps can be powered
with macros and no VBA?
 
L

Linq Adams via AccessMonster.com

<Control> + G takes you to the code module for the form.All the VBA code for
the form goes here. No idea why the "G" it's just the shortcut key combob.
You can get to the code module with this, or by going to View - Code, or by
going to the Properties Box - Events for a given control and clicking to the
right of the box for an event, on the ellipsis (...) which will take you to
the code module and set up the first and last lines of the sub for this event,
such as

Private Sub MyButton_Click()

End Sub

This is actually the preferred way for placing code for a
textbox/button/combobox control. It "connects" the control and the event.
Events for the form itself, such as

Private Sub Form_Load()
DoCmd.RunCommand acCmdRecordsGoToNew
End Sub

can be placed using the method I described earlier. The only thing to
remember is: if you already have a Form_Load() sub in your code, and you need
to add code to it (say someone on a forum gave you some code) you need to
consolidate your current code and the new code, so that you only have one
Form_Load() sub.

And you're roght about the Micro$oft manuals! The last one I bothered with
was for MS DOS, which was a disgrace! I've gone the alternate source for
manuals ever since.I actually wrote a relational database for tracking home
care patients using QB 4.5, mouse support and all.it had, I think, 67.exe
files, which is pretty big. I'm currently porting it to Access with the idea
of marketing it. If you like QB 4.5 you'll love VBA!

To David: ACC 2007 is a whole different animal. Allen Browne has an extensive
review of 2007 on his site, called "The good, the bad and the buggy" that
states that they have bolstered Macros, giving them some error handling
ability and a few other things, such as allowing the use of variables, but
that they are, in his words "still inadequate for most serious tasks."

Linq

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

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
D

David W. Fenton

<Control> + G takes you to the code module for the form.All the VBA
code for
the form goes here

No, Ctrl-G is the command to open the Immediate Window (or is it
called the Debug Window again?). Since that opens in the VBE, it
will usually open with the code module of the active form open. But
that's a side effect of opening the immediate window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top