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!

Conditional Autonumber 1

Status
Not open for further replies.

nisbets

Programmer
Jan 16, 2001
3
GB
I wish to create a conditional autonumber field using two numbers within the same field. I can do this in excel with the following queries.

A B
1 PRO 900000
2 900000
3 PRO =IF(A4=&quot;PRO&quot;,COUNTIF($A$4:A4,&quot;PRO&quot;)+$B$2,COUNTIF ($A$4:A4,&quot;<>PRO&quot;)+$B$3)
4 =IF(A4=&quot;PRO&quot;,COUNTIF($A$4:A4,&quot;PRO&quot;)+$B$2,COUNTIF ($A$4:A4,&quot;<>PRO&quot;)+$B$3)

I later concatenate the two columns to create unique records. As you can see the strings would end up being PRO900001 or 900001.

I would be very grateful for any help.
 
Go here, See this. It would need some minor mod to return your string format, but it essientially does this function.

faq700-184 Why AutoNumber shouldn't be used in MultiUser databases (And How to ge the Unique Number)


MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top