You can't go to the specified record

G

Guest

Hello,

I have read previous discussions on this issue but it does not satified my
problem with this error.

I will be VERY, VERY grateful if someone can help some my problem:

I am currently creating an expense tracking program using Access 2002 and I
have encountered an error stating "You can't go to the specified record" when
you are trying to add a new record into an ODBC table called "Project Code".
I have various tables (in ODBC) in which I am successfully able to add,
update and edit but with this particular table, I am not able to add records
(through the program, but can do it manually).

Here is a breakdown of what I have:

The form - "Add New Project Code" has all of its properties turned on to YES
(such as Allow New Additions). Plus I have the Recordset Type pointing to
Dynaset (Inconsistent Updates).

The macro behind a click button (Add New Record) states the following:

DoCmd.GoToRecord , , acNewRec

The macro in open this form (Add New Project Code) is the following:

Function Menu_Add_New_Project_Code1()
On Error GoTo Menu_Add_New_Project_Code1_Err

DoCmd.OpenForm "Add Accounting Project Code", acNormal, "", "", acAdd,
acNormal
DoCmd.Maximize

Menu_Add_New_Project_Code1_Exit:
Exit Function

Menu_Add_New_Project_Code1_Err:
MsgBox Error$
Resume Menu_Add_New_Project_Code1_Exit

End Function

Does anyone have a solution??? :-(
 
G

Guest

There could be several possibilities as to what is happening.

Firstly off, I would like to encourage you to use some type of naming
convention. It doesn't have to be any formal naming convention that may be
taught in a classroom, but for the most part anyone doing advanced work in
Access would not use any spaces in the names of objects. You say you are
dealing with ODBC and some external data sources are not setup to deal with
spaces in table names. Another convention is to start the name of objects
with an abbreviate of that object, for example a table would be
tblAccounting, then you would also want to group all related objects
together, like your account macro named macAcctProjectCodeAdd. Some ppl like
using the underscore instead of scrunching it all into one word, like
acc_Acct_Project_Code_Add - also, I sub-grouped the Project Code and finished
with Add. Like I said, you don't have to use any standard conventions, I'm
just explaining how I would name it and why. I know, depending on how far
into the project you are, it may be too late. But there is a tool out on the
web (you or your company would have to buy) that allows you to not only
rename objects but it will search all of your code, SQL statements,
everything and update the new name for the old.

Now, as for your problem. My first suspicion is that you may be trying to
add a record on the form and you aren't appending all the required fields in
the table, since you said you can add it manually (I'm assuming with a
directly SQL statement on the server side).

But when I thought about this possibility it is dependent upon when you are
getting the message. I am assuming your macro is trigerring the error, and
your macro is triggered to run when the information being appended is already
entered and the user is trying to save the data. Let me know if these
assumptions are correct, and any other pertinent info you may think of, and
I'll try and help further.
 
G

Guest

Thank you "rolaaus" for your response.

First, I DO KNOW about formal naming convention. The actual name of my
table is ROR_Project_Code. As you can see I was writing it in simplier terms
so that anyone reading this would understand.

Now back to my problem, thank you for your solution but it does not help me
in resolving this issue. Let me explain a bit further.

I use the same procedures for four other tables beside (ROR_Project_Code)
and they are:

1. ROR_Users
2. ROR_Budget_Code
3. ROR_GLAccount
4. ROR_Department

With these tables, I am able to update, add and delete records except for
ROR_Project_Code. In selecting the "Project Codes" option, you are brought
to a form that gives you choices to either Add, Update or Delete. The other
options works except for Add option. As I had said in my previous (but
simple) posting that the error appears after you click on the button to Add
(using the macro supplied by MS Access).

I hope this is helpful. Thank you.
 

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