run macro and get error: The command or action "Paste" isn't avail

G

Guest

Error message: The command or action 'Paste' isn't available now. Please
help. thank you.
 
S

Steve Schapel

Karen,

Wehn, where, how, and why, does this error occur? If your question is
related to a macro in an Access database, what is the macro, what is it
supposed to do, and what are the details of the actions and relevant
arguments in the macro?
 
G

Guest

This Access 97 database was set up by someone else. When the user clicks the
paste into tables button (on click) then the macro called mcr copy runs to
copy the new employee information into several different tables. When the
user clicks the paste into table button the follow error message appears:
The command or action "PasteAppend' isn't available now.
* You may be in a read only database or an unconverted database from an
earlier version of Microsoft Access.
* The type of object the action applies to isn't currently selected or isn't
in the active view.

Use only those commands and macro actions that are currently available for
this database.

Then another time I select the button the message at the beginning is
different in that it states that the 'Paste' isn't available now, with the
rest of the information the same.

Our SA faked the P: drive with a subst command, but we can re-link the
tables to fix that problem. Would this cause the problem?

Thank you
 
G

Guest

Action: SelectObject frm temp
Action: GoTo Control go to ssn
Action: RunCommand copy snn
Action: OpenTable open tbl clear
Action: RunCommand paste
Action: Close
Action: OpenTable open tbl permits
Action: RunCommand paste
Action: Close

The macro goes like this until it has copied the SSN into all the tables
then it goes back to the selectobject frm temp and starts getting the other
information which next is the lastname. It's getting this information from a
"form" where the person enters all the employee type information into the
form and clicks on the button to paste which the macro goes and pastes all
the information from the form into all the tables.

Thank you!
 
S

Steve Schapel

Karen,

Thanks for the further information. Regarding the macro, it seems to me
that there would need to be a GoToControl action following each
OpenTable action, in order to locate the focus in the field where the
Paste is supposed to occur.

But, all that aside, my main question here would be whether the design
of this database is set in concrete, or if you could consider a
re-structure. Basically, this approach is not a very good one. In
fact, it's very bad. First of all, it is almost certain that data like
SSN and Lastname should absolutely not be getting put in multiple
tables. Secondly, this type of thing is a job for an Append Query or an
Update Query, not to use a macro in this way to mess with tables. And
third, if there are one-to-many relationships between data elements,
Access provides forms and subforms for the entry of data directly, which
should be very easy... much easier than trying to move and copy and
paste stuff all around.
 
G

Guest

Thank you, Steve, for all this great information. Using Access 97 has been
such a struggle for us and to get all the applications we have upgraded to
2003 is going to be a "bear".

I just talked to our SA and he told me that if I re-link the tables to the
N: drive, which is where the info actually resides, then it should fix the
error I'm receiving. Right now the SA has the tables linked to the P: drive
and faked to point to the N: drive. So I'm going to do that and hope it
fixes it.

I found that a user set up the macro and I agree with you that there is a
better way to do it and I appreciate the great information you provided to
me. Right now my task is to get it "fixed" to work and then I can work on
making it better later.

Thank you so very much for all your help and support. I really apprciate it.
 
S

Steve Schapel

Karen,

Well, I don't have the foggiest idea what "the tables linked to the P:
drive and faked to point to the N: drive" means, but let's hope it works
after that.
 
G

Guest

Hi Steve,

So, I don't know what I'm doing right but when I try to re-link the tables
from the P: drive to the N: drive I don't seem to be accomplishing it. When
I select
File
Get External Data
Link Tables
Select the DB name
Select Link
It only displays three tables and one of the tables is called Paste errors.

Should I be going to:
Tools
Add-In
Linked Table Manager

But when I go here that's where they are all showing the P: drive and I need
to change it to the N: drive.

How do I get these all to change and point to the N: drive?

I'm still getting the same error message:

The command or action 'Paste' isn't availalble now.
*you may be in a read-only database or an unconverted database from an
earlier version of Microsoft Access.
*The type of object the action applies to isn't currently selected or isn't
in the active view.
Use only those commands and macro actions that are currenlty available for
this database.
OK (is the option to select at this point)

Someone did point out this:
In searching for a solution to the PasteAppend problem, I found the
following web site. In the link for the ActiveX data objects, it specifies
that we should use 25 and we are using 20. This may be our problem. This is
kept in the registry, so Karen and I can not change the setting. To see the
references, you can use Control-G and get into debug mode. The Tools menu
then have an entry for references.

http://allenbrowne.com/ser-38.html

That do you think about this? Do you think if we change and use 25 instead
of our current 20 it would "fix" our problem? The other issue I wander is
that there are other Access 97 databases on this Citrix server and I wouldn't
want to make this change and "affect" in a bad way any other Access 97
databases. What do you think?

I can't seem to find anyone who can understand what's going on and you seem
to be my only hope at this point.

Thank you very much for all your assistance.
Karen
 
S

Steve Schapel

Karen,

To be honest, I am having a great struggle here to understand your
situation. It is good that you mentioned you are running in a Citrix
environment. But all the talk about P: and N: and 20/25 goes right over
my head, of course, because I can't see your computer from here, and you
haven't explained what any of this means. So, let's go back a step...
You have a split database structure, right? With a front-end
application file, and a back-end data file, is that right? Well, you
can certainly use the Linked Table Manager, if it is installed, to get
this set up correctly. Tick the little box at the bottom where it says
"prompt for new location" than click 'Select All', and then 'OK'. After
that, it will ask you to point to the data file, so as long as you know
what and where the data file is, this should be sweet.

So, you may have a references problem... that's another question. But I
agree that getting the data links correctly set up first is the best
approach. And then, as I said earlier, the whole concept of doing
copy/paste in macros, and replicating the same data from one table to
another, indicates a serious design problem that really needs to be sorted.
 

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

Top