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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset AutoNumber ?

Status
Not open for further replies.

ooops

MIS
Dec 21, 2000
91
US
I got some kind of weird behavior if I delete table from the below code.
When I save new record, it saves twice the first time. Anyone knows why ? Thanks.

With DoCmd
.SetWarnings False
.RunSQL "Delete * from tblJurCode"
.SetWarnings True

.Rename "tblJurCode_Old", acTable, "tblJurCode"
.CopyObject , "tblJurCode", acTable, "tblJurCode_Old"
.DeleteObject acTable, "tblJurCode_Old"
End With
 
What are you trying to do? What do you mean by "saves twice"? What do you mean by weird behavior?

It will help us to help you if you're a lot more specific.

Also, because your Subject for this thread is "Reset Autonumber ?", please take a look at this page, , where I discuss why attempting to reset the autonumber is a bad idea.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
I got that problem solved already. It has nothing to do with this delete command. Thanks.
I do have another question for this though. If I put the delete button on a form that have no control tied to the table then it is fine. Is there anyway I can put this button on the form that have controls tied to fields on the table ? What's the extra steps that I have to do ?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top