Topics Search

change autonumber

change autonumber
Views: 4
I have a table where the primary key is autonumber. Is it possible to change the autonumber to a field with text.for example. It would be great if I can have that field fill in automatically with something like INV001, then INV002, then INV003.
Sponsored Links:

More topics

 

Setting the value of Microsoft Access AutoNumber Field

Preview
By using an append query, you can change the starting value of an AutoNumber field in a table to a number other than 1.
Microsoft Access always numbers AutoNumber fields beginning with the number 1. If the table has data in it already, the starting value of the autonumber will be higher than the highest value already in the table. You cannot manually edit an AutoNumber field or change its starting value.
 

Resetting Autonumber Field In Code

Preview
I know. I Know. But is it possible to reset an Autonumber Field in Code. Here's what I have tried.

1) Delete all records in an existing Table.

Now I would like to change the attributes of the IDField, so

The current Field Attributes are dbAutoIncrField. I want to reset it to dbFixedField to clear the AutoNumber Attribute

fldIDX.Attributes = dbFixedField

But it doesn't like this. Error is Invalid Operation.

I ASSUME THIS MEANS I CANNOT CHANGE THE ATTRIBUTE. OH WELL.

If anyone has any insight into how to Reset an Autonumber Field without repairing and compacting the database, I woull really enjoy seeing how you did it.
 

Convert Long Integer Number to Autonumber

Preview
Tried to convert a Long Integer column to Autonumber and get the error:
"Once you enter data in a table, you can't change th edata typ of any field to AutoNumber, even if you haven't yet added data to the field."

Just normalized many tables into one table by turning off the Autonumber.
Used a Hashing method to keep track across the many updates.

The field that I need to change back to an autonumber starts at 1,000 to 1,832 - has gaps (tht was the first table), then 2,000 to 2,304 - has gaps (that was the second table) . and so on.

All I need to do now is to convert my first column (Long Integer) back to an Autonumber - and keep the data carefully migrated in.
 

AutoNumber

Preview
Is it possible to change how an AutoNumber is formed. For example I have a customer database, each custor has a Customer Code which is an AutoNumber, coluld I have it so that the Customer Code began with Co- then the number i.e Co
 

Why Doesn't the autonumbers change?

Preview
I am having a table in which I have an autonumber field. But I want to re-apply the autonumber after sorting the data. I cannot do it. Why doesn't the sequence of autonumbers change? I want to know the fundamentals of it. Kindly
 

Autonumber in form and subform question

Preview
I have a form and subform as shown below. The order number in the main form and in the subform is entered manually but of course ideally the Order Number should be an autonumber.

I've tried to change it by going through the steps to change the number field to an auto number (delete the relationships, make the change, put the relationships back). Both Order Number fields should be of the same type otherwise I can't make a relationship between them and the Order Number in the subform won't automatically be the same as in the main form.

The trouble is, being an autonumber, once I start to enter item no.2 on the subform the Order Number field goes to 2 when it should still be Order Number 1.

Is there a way of making the Order Number field an autonumber but have the subform keep that number on records higher than 1?
 

Autonumber form and subform question

Preview
I have a form and subform as shown below. The Order Number in the main form and in the subform is entered manually but of course ideally the Order Number should be an autonumber.

I've tried to change it by going through the steps to change the number field in the table that the subform is based on to an auto number (delete the relationships, make the change, put the relationships back).

Both Order Number fields should be of the same type otherwise I can't make a relationship between them and the Order Number in the subform won't automatically be the same as in the main form.

The trouble is, being an autonumber, once I start to enter item no.2 on the subform the Order Number field goes to 2 when it should still be Order Number 1.

Is there a way of making the Order Number field an autonumber but have the subform keep that number on records higher than
 

How to make a custom autonumber?

Preview
I was wondering if there is a way to have a more dynamic auto number system.

I basically want to enter invoice numbers, but usually the invoice numbers are successive i.e. 5243, 5244, 5245

But sometimes there will be a jump such as 6667,6668,6670, ect.

So I was wondering if there is a way to build an autonumber system that tries to auto complete the next number for you based on the initial number, so say if I typed 7000 as an invoice number and went to the next record, I would want the next record to fill in 7001 for me unless I go and manually change it to something else.

Is it possible to change the autonumber system built into access in order to accomplish this?
 

Duplication check on tables. AutoNumber

Preview
I have two master tables set up.

Right now in both tables, I have the PK set on a particular field(so the PKs are not the AutoNumber)

If I manually change the PK to be the AutoNumber for each of the two tables, is there any way to prevent adding the same records twice in each table?

I am assuming this can be done in a little VBA code? Some kind of duplication check?

Could someone guide me on how to go about implmenmenting this feature
 

Changing Empty Field Format To AutoNumber With Macro

Preview
I have used a data definition query to add a new field to a populated table and set the format of the new field to number. The new field contains no data but other table columns do contain data.

I would like to be able to change the format of the new field from Number to AutoNumber so that it auto populates but rather than do it manually I would like to change the field format from within a macro.

I have looked at the runcommand option available as a macro action but cannot find any method to make the change from within a macro. If I had some code in a module I would be able to use the OpenModule or possibly the RunCode action in the macro but my coding skills are nil.

If there are any solution or suggestions as to how I can go about changing the field format from Number to AutoNumber from within a macro I would be most grateful for