I have a bit of code (received gratefully from a tektips forum) that I want to sequentially increment an ID field.
If Me.NewRecord Then
...
...
If DMax("Contact ID", "Contact Information"
= 0 Then
Me.[Contact ID] = 1
Else
Me.[Contact ID] = DMax("Contact ID", "Contact Information"
+ 1
End If
I have it activated on the OnLoad event - trouble is I'm getting a missing operator error but I don't know why. Also I can have more than 1 'Contact' per 'Site' but it doesn't activate when I move to a new record on my 'Contact' form.
Any ideas?
Thanks in advance.
aexley
If Me.NewRecord Then
...
...
If DMax("Contact ID", "Contact Information"
Me.[Contact ID] = 1
Else
Me.[Contact ID] = DMax("Contact ID", "Contact Information"
End If
I have it activated on the OnLoad event - trouble is I'm getting a missing operator error but I don't know why. Also I can have more than 1 'Contact' per 'Site' but it doesn't activate when I move to a new record on my 'Contact' form.
Any ideas?
Thanks in advance.
aexley