Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Code "2499"

Status
Not open for further replies.

tpowers

Technical User
Nov 2, 2002
153
US
I am trying to save a record by running the vb code "DoCmd.GoToRecord , , acNewRec" and some how every time I run the code I get this error message that says "You can not use the GoToRecord action or method on an object in Design view, but I do not have any objects in design mode.

Does anyone know why this may happen?


Thank you in advance,

TPowers
 
Hi

Two points

I am trying to save a record by running the vb code "DoCmd.GoToRecord , , acNewRec

acNewRec, creates or moves you to the empty New Record, it does not save a record, to save you need DoCmd.RunCommand acCmdSaveRecord

second point if you are stepping thru the code you are in design view

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
How are ya tpowers . . . . .

The [blue]DoCmd[/blue] you've posted should work! ([blue]Ken[/blue] . . . don't forget you can save a record by changing records, which is what happens when we goto new record, AKA [blue]acNewRec[/blue]).

I ran a number of simulations using the DoCmd in different events, and the only failure occurs with the [blue]Before Update[/blue] event, but a different error.

I also ran simulations [blue]stepping thru the debugger[/blue], with the same results above.

So . . . . where are you running the Docmd from?

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top