Hi there
I've got a subform which needs an auto-incremented number as one of its fields.
I was using the following code previously, which works fine - but i recently put in code to allow the user to 'archive' a record (effectivly this stops the record being selected by the subform, but keeps it in the table). This means that if there are 4 records (1,2,3,4) and number 2 is archived, i need the numbers 3 and 4 to become 2 and 3.
Is this possible?
here is my current code:
If IsNull(DLookup("[Querynumber]", "tblQuery", "[tblsubjectID] = text37")) Then
MsgBox "no query records"
Me.Querynumber.Value = "1"
End If
If IsNull(Me.Querynumber.Value) Then
Me.Querynumber.Value = Nz(DMax("[Querynumber]", "tblquery", "( [tblSubjectID] = Text37 AND Active = yes)") + 1)
End If
Thanks in advance for any help,
Lista
I've got a subform which needs an auto-incremented number as one of its fields.
I was using the following code previously, which works fine - but i recently put in code to allow the user to 'archive' a record (effectivly this stops the record being selected by the subform, but keeps it in the table). This means that if there are 4 records (1,2,3,4) and number 2 is archived, i need the numbers 3 and 4 to become 2 and 3.
Is this possible?
here is my current code:
If IsNull(DLookup("[Querynumber]", "tblQuery", "[tblsubjectID] = text37")) Then
MsgBox "no query records"
Me.Querynumber.Value = "1"
End If
If IsNull(Me.Querynumber.Value) Then
Me.Querynumber.Value = Nz(DMax("[Querynumber]", "tblquery", "( [tblSubjectID] = Text37 AND Active = yes)") + 1)
End If
Thanks in advance for any help,
Lista