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

Format AutoNumber

Status
Not open for further replies.

Brogrim

Technical User
Jul 28, 2000
184
IE
I have a table of Customers and a table of employees. When I enter a record on the invoice table and fill in the customers and employee details Is it possible to generate a uniquie Identifier based on the Customers and Employee Table.

Ie CUS1EMPLOYOOO1.

Thanks for the Help

 
That's not an 'Autonumber'. Access is very specific about autonumber, it's a long integer and you can't really format it or change it's behavior. You can however do what you're asking by taking your existing information (CustomerID, EmployeeID) and sometime in your process fire an event that takes each piece, combines it to something different and use that new piece of information as the primary key of a new table.

We would need a little more information about what you're doing to help determine the best time to fire the event.

HTH


Leslie
 
Thanks for the advice.

I wantt to do the following, when I create an invoice I want a field on the record to reflect the Customer and Employee who raised the invoice on it.

ie
Customer - Jones Technlogy
Employee - Alan Grimes
Invoice No - Automumber

The field would then look like

AGJonTec00001

I hope that explians it a bit better.




 
As lespaul already mentioned, this is NOT an autonumber....it is a custom defined key. You will need to set up a custom id generator....

questions:

How is the number generated? Is it one up for all entries, or one up per customer, or one up per employee, or one up per employee/customer?

How good are your VBA skills?

What is your database structure currently like? Please post us your tables in the following format:

TableName
FieldName Type (PK)
FieldName Type
FieldName Type

With this info, we can help you create the function you need for your Ids...

****************************
When the human body encounters disease it raises its temperature making it uncomfortable not only for the body but also for the disease. So it global warming the Earth's way of saying we are not wanted?

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top