K
Kevin
Jody,
OK, I forgot about something. The append query is trying
to append your Activity _ID field into the table and can't
because that is the primary key for the table. Do this:
1. Change the current Append Query to a select query, then
from that select query make a new query with this one
being an append query into your table. In this query, do
not include the Activity_ID. Save the query.
2. In the copy function code you will have to change the
name of the query your calling to this new query.
Now test what you've done.
If this still does not work, comment out the
docmd.setwarnings False and docmd.setwarnings True lines
by placing a single quote (') to the left of each line.
Also, before any code except the function header put the a
line that reads "On Error Goto 0" (that is zero).
If you have a code error, you will get a message that will
allow you to Debug or to End the subroutine. Choose debug.
Post back at that point and tyell me what happens.
If the problem is due to a problem in the query you will
get a message that indicates that access could not append
the records and will give some other information. Read
that message carefully and post back with what it tells
you.
When you post back, post back to this thread so I can look
back at what I have told you so far and so other people
can follow what is happening and maybe chime in with a
solution.
With these two actions, you should get an error message of
some sort if something is still wrong.
Hope that helps and sorry for the misguided information!
Kevin
OK, I forgot about something. The append query is trying
to append your Activity _ID field into the table and can't
because that is the primary key for the table. Do this:
1. Change the current Append Query to a select query, then
from that select query make a new query with this one
being an append query into your table. In this query, do
not include the Activity_ID. Save the query.
2. In the copy function code you will have to change the
name of the query your calling to this new query.
Now test what you've done.
If this still does not work, comment out the
docmd.setwarnings False and docmd.setwarnings True lines
by placing a single quote (') to the left of each line.
Also, before any code except the function header put the a
line that reads "On Error Goto 0" (that is zero).
If you have a code error, you will get a message that will
allow you to Debug or to End the subroutine. Choose debug.
Post back at that point and tyell me what happens.
If the problem is due to a problem in the query you will
get a message that indicates that access could not append
the records and will give some other information. Read
that message carefully and post back with what it tells
you.
When you post back, post back to this thread so I can look
back at what I have told you so far and so other people
can follow what is happening and maybe chime in with a
solution.
With these two actions, you should get an error message of
some sort if something is still wrong.
Hope that helps and sorry for the misguided information!
Kevin