Populate a field with a sequence number based on two criteria

moore020

Registered User.
Local time
Today, 01:49
Joined
Sep 4, 2014
Messages
25
I am trying to get the max of an integer field if the ProjectNumber field is equal to the ProjectNumber field in the current record. I have used code similar to the one below before but it was on a date field, then add one.

Me.RevisionNumber = Nz(DMax("[RevisionNumber]", "dbo_ProposalLog", "[ProjectNumber] =" & Me.ProjectNumber), 0) + 1

The ProjectNumber field is a text field.
 
I think I am really close with the code that I posted but I keep getting a missing operator error.
 
Scratch the idea of using multiple criteria, I cant get the code line that I posted to work. I am getting an operator error. I added brackets before and after ProjectNumber but it is still erroring out.
 
Is ProjectNumber Text or Numeric? OR have you just moved on...
 
This is the code that worked for me. It had to do with Project Number being a string instead of a date or number.

"[ProjectNumber] = '" & Me.[ProjectNumber] & "'")
 
Yep, that is why I asked, I thought that might be the case...
 

Users who are viewing this thread

Back
Top Bottom