Take another look at
DoCmd.CopyObject
Put a your "default" table into your front-end. You can then copy that to your backend.
DoCmd.CopyObject "C:\My Documents\Copy of NewsgroupAnswers.mdb", "faqtest",
acTable, "Faqsrc"
You will get a warning message that the old table already exists, but you can
still replace it.
Tim Ferguson wrote:
>
> =?Utf-8?B?QmlsbCBCcmlua3dvcnRo?=
> <(E-Mail Removed)> wrote in
> news:B63804BC-5DCA-43C8-B6E6-(E-Mail Removed):
>
> >
> > if i delete all but the first record, i won't be able to renumber them
> > and that is what i'm trying to accomplish: to sent autonumber to #1.
>
> <yawn /> If this is important, then you probably have a Design Problem.
> See DB commandment number 7 as quoted in my post.
>
> > I tried docmd.deleteobject and docmd.copyobject but because the data
> > is linked to the program, it won't work. I'd have to relink with code
> > and i don't know how to do that either.....
>
> Not sure what you mean by "linked to the program"...
>
> One way to get round relationships, if there are any, would be to empty
> the table and then put back your dummy row:-
>
> DELETE FROM MyOldTable;
>
> INSERT INTO MyOldTable (IDNum, FieldOne, FieldTwo)
> SELECT ID, One, Two FROm MyMasterTable;
>
> (if the dummy record is not going to change, you could even get rid of
> the dummy table altogether by embedding the values sic:-
>
> INSERT INTO MyOldTable (IDNum, FieldOne, FieldTwo)
> VALUES (1, NULL, "This is a dummy record");
>
> Of course, this will not reset the autonumber, but then again it
> shouldn't matter. Seriously: I have severe misgivings that your project
> needs a Design Revision. This is not what autonumbers are meant to do.
>
> All the best
>
> Tim F
|