View Full Version : append query - huh?


subboy
11-07-2001, 10:10 AM
i'm trying to follow Help's directions in running an append query to change an AutoNumber back to 1 ("Change the starting value of an incrementing AutoNumber field").

i can follow most of this; the part that loses me is setting the criteria. there is no guidance at what the criteria needs to be; i've tried a number of things, but haven't been getting very far. this must be simple??

thanks in advance.

Graham T
11-07-2001, 11:05 AM
1. Create a temporary table with just one field, a Number field; set its FieldSize property to Long Integer and give it the same name as the AutoNumber field in the table whose value you want to change.

2. In Datasheet view, enter a value in the Number field of the temporary table that is 1 less than the starting value you want for the AutoNumber field. For example, if you want the AutoNumber field to start at 100, enter 99 in the Number field (in your case enter a value of 0)

3. Create and run an append query to append the temporary table to the table whose AutoNumber value you want to change.

4. Delete the temporary table.

5. Delete the record added by the append query

HTH

subboy
11-07-2001, 11:18 AM
i guess i wasn't clear.
i have read the Help file for this topic. what the Help file does not explain is what the criteria needs to be, how it should be set up (i have the worst time with queries).

thanks.

Graham T
11-08-2001, 05:39 AM
Subboy

The actions needed are to create a new table (call it something like temp_table), this need to include just one field, named the same as the autonumber field in the table you wish to ammend. (For example IDNumber). Set it's field type to Number and field property to Long Integer.

In this table enter a value of 0 into the first record and save the table.

Create a new query, based on temp_table. Include the field (IDNumber), change this to an Append query and set the Append To: your table you wish to append the autonumber of.

Run the query (!) and this will tell you that you are about to append 1 row.

Go to your original table and delete the record that you have just appended.

When you enter a new record the auto number should then start at 1.

HTH

Graham

[This message has been edited by Graham T (edited 11-08-2001).]