Hello All,
Long time browser but new member.. and I hope someone can help me.
Basically I have to create a database which when a new person joins a GroupNumber they get their own letter.
e.g.
A person joins group 1 and is assigned letter A. They then join group 2 and again are assigned a letter A within that group. A second person joins group 1 and are assigned a letter B. This would give the following in the table:
GroupNumber GroupLetter
1 A
2 A
1 B
I have tried the following, but with incrememtal numbers instead of letters, on a form as a BeforeUpdate:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord = True Then
Me.CounterField = Nz(DMax("CounterField", "MyTable", GroupNumber = Me.GroupNumber), 0) + 1
End If
End Sub
But the whilst the form does increase the counterfield number it does not take into account the me.GroupNumber which has been entered into the form.
Can anyone help?
Thanks
Long time browser but new member.. and I hope someone can help me.
Basically I have to create a database which when a new person joins a GroupNumber they get their own letter.
e.g.
A person joins group 1 and is assigned letter A. They then join group 2 and again are assigned a letter A within that group. A second person joins group 1 and are assigned a letter B. This would give the following in the table:
GroupNumber GroupLetter
1 A
2 A
1 B
I have tried the following, but with incrememtal numbers instead of letters, on a form as a BeforeUpdate:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord = True Then
Me.CounterField = Nz(DMax("CounterField", "MyTable", GroupNumber = Me.GroupNumber), 0) + 1
End If
End Sub
But the whilst the form does increase the counterfield number it does not take into account the me.GroupNumber which has been entered into the form.
Can anyone help?
Thanks