RE: You can't go to the specified record

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: rolaaus (rolaaus_at_discussions.microsoft.com)
Date: 12/30/04


Date: Wed, 29 Dec 2004 16:25:06 -0800

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.

"Fisher666" wrote:

> 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??? :-(
> --
> Esther Fisher



Relevant Pages

  • Calling conventions
    ... The Windows API uses the stdcall convention where the called procedure ... is responsible for cleaning up the stack. ... In NASM I would use a macro ... I would use a different macro to handle the cdecl calling ...
    (alt.lang.asm)
  • Re: Macro var args
    ... On Sat, 15 May 2004 22:08:46 GMT, Siemel Naran wrote: ... > With va_list one often uses the convention that the last entry is NULL. ... The aim for the macro was to make it simple, ...
    (comp.lang.cpp)
  • Re: How can I improve my macro that delete all headers&footers from the document?
    ... but because a consistent naming convention makes ... but that is entirely a matter of local convention. ... So, I would write your macro a bit differently, but I don't think it could ... Dim hf As HeaderFooter ...
    (microsoft.public.word.vba.general)
  • Re: How can I improve my macro that delete all headers&footers from the document?
    ... it is clear enough what the macro is supposed to do. ... but that is entirely a matter of local convention. ... Dim hf As HeaderFooter ... End Sub ...
    (microsoft.public.word.vba.general)
  • Re: How to name variables in a program?
    ... The Java naming convention is pretty good on this. ... the symbol is with the first letter capitalized, ... I would also *HIGHLY* warn you against the hungarian notation. ...
    (comp.programming)