I have a year field that automatically enters the current year when creating a new record. From there, I want my form to check the project number field to see if it is null, and if it is, count the duplicate amount of years and then add 1.
For example, I create a new record. The code checks and sees that there are ten 2010 entries in the year field. It then adds 1 to the 10 and displays it in the project field.
I have a query that checks for duplicate entries in the year field. Is there a way to call that field in vba and add 1?
I'm stuck at this right now:
If IsNull(ProjectNumber) Then 'checks if field is null
ProjectNumber = QryYear 'want it to count dups then add 1
Else
'do nothing
End If
End Sub
For example, I create a new record. The code checks and sees that there are ten 2010 entries in the year field. It then adds 1 to the 10 and displays it in the project field.
I have a query that checks for duplicate entries in the year field. Is there a way to call that field in vba and add 1?
I'm stuck at this right now:
If IsNull(ProjectNumber) Then 'checks if field is null
ProjectNumber = QryYear 'want it to count dups then add 1
Else
'do nothing
End If
End Sub