Link to home
Create AccountLog in
Avatar of mpden32
mpden32

asked on

Microsoft Access AutoNumber Help

I have a form called Orders which contains an AutoNumber field.
Here is what i am trying to accomplish.
1.  Put in an order and generate the order number at the time of saving the record and display it in a message box.

Whats I am currently doing is using autonumber but my issue is when i populate the first field on the form it generates the number.  If a person closes the form before completing the record then i have a record with bogus data.  Is the only way to get around this is to make every field I need required on the table.  If so is there a way to make the error message very simple if the field is not populated when the window is closed rather then giving the long error mesage a user might not understand?

Also I know you can only have one autonumber field on a table.  Can you please offer another way to add an additional auto number / text field.  This would be for a PO to be autogenerated. exa LA1000.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Why don't you make your own "auto number"?!? Make a count query to check how many records you've saved on your table when you open your form. Then display the number of records+1 on a textbox of your form and only when you save the record you assign the value to a field of your table.

To create a PO, you can use the autonumber on this field because on the first field you can remove the autonumber and use a solution like I gave you.

jppinto