I'm taking a blind guess, since there isn't much data about the table provided:

[VBA]IIF(Count(TableName.FieldName) = 0,LAST_INSERT_ID,Count(TableName.FieldName)[/VBA]

The above SQL uses an IIF (not a typo) to check the returned value of the count. If it is 0, then it uses what you defined. If it does not meet the condition, then it returns the count.

This should give you a basic idea to build on.

HTH