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

How to change AutoNumber datatype programmaticlly 1

Status
Not open for further replies.

RodgerC

Programmer
Jul 9, 2001
6
NZ
I am developing a database that needs 3 Client tables, different types of clients having different sorts of data stored. My problem is I want ClientIDs that are unique over the whole 3 tables.

I'm familiar with Visual Basic so thought I'd add abit of code that incremented ClientID by one when it was replicated in another table. eg.

If (ClientTable1.Cid = ClientTable2.Cid) then
ClientTable1.Cid = ClientTable1.Cid + 1
End If

Trouble is I can't find where to insert this sort of code. I have tried the validation area of the Table. The Access doesn't seem to provide a place for validating an AutoNumber, understandibly.
 
I'm doing something similar, except I want to make my autonumber go 1, 2, 3, 4, 5 etc, unless told otherwise and then go 2.1, 2.2, or 3.1, 3.2. This is for invoicing.
Rather than use autonumber can you not just use long integer and write code to make it behave like an autonumber. (surely that's all MS do anyhow).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top