Function that calls a table

V

Vaughn

Can anyone help,
This is my problem.

A table (ID_Table) comprises two columns each holding 3
alpha (strAlpha) and 3 numeric (strNum) characters. Using
this data a function Find_ID will generate a 6 character
ID string.
The table, ID_Table is created in access and the function
Find_ID will be accessed by a button clicked on a form
created in my database.

I think this is what the Algorithm should be :

* Pass strAlpha to the Find_ID function,
* Open ID_Table
* While "not end of table" search for strAlpha
* If found, increment the corresponding number part
strNum, store this in ID_table, concat strAlpha with
number and return this value as a string
* If not found store strAlpha in ID_Table together with
number strNum = 001,concat strAlpha with number and
return this value as a string

What is the best way to achieve this?
What will the code look like in the function Find_ID?
Can a table be accessed like a file ?

Thank for your help
 
Top