This is a violation of Third Normal Form. A Key must not depend upon the
value of another field. It can include the value (such as in a compound
key), but not depend upon it. I suggest that if you need this, that you use
it as an index, but not as the Key. An example of a date field with and
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10792
incrementing number might be something like (air code):
Function NextJobnum()
Static intNum As Integer
Dim db As DAO.Database
Dim rst As DAO.Dynaset
On Error Go To Error_Handler
Set db = CurrentDb
Set rst = db.OpenRecordset("Select [JobNum] from [MyTable] Order By
[JobNum];")
If Not rst.EOF Then
rst.MoveLast
intNum = val(mid(rst.Fields("JobNum"),7)) + 1
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10792
Else
intNum = 1
End If
NextJobnum = Month(Date) & Day(Date) & intNum
ExitHere:
On Error Resume Next
rst.Close
Set rst = Nothing
Set db = Nothing
intNum = 0
Error_Handler:
Resume Exit_Here
End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com http://www.mvps.org/access
"Holly1"
wrote in message
news:6AC839C6-DFC8-4368-A6FF-DD5B6FD25F0E@microsoft.com...
> I am in the process of creating a new table which requires me to produce
> unique identifying numbers, which are also dependant on information on
> another field within the same table. I have no idea how to do this.
Please
> help.
> --
> Holly1