Hi,
I am somewhat new to Access code. I am trying to make a number field in a table default to the highest number in that table plus 1 within a given client.
I have a table (named ClaimData) that I input data through a form which gets filtered by an After Update, Event Procedure macro via an unbound combobox (AuditCode) to the client I am currently working on (table AuditData is the list of all Clients).
When I identify an issue for a client, I enter the new information in ClaimData and I assign it a claim number (ClaimNo). Each client may have anywhere from 15 claims to 200 claims. When I use the below code in On Click, Event Procedure in a vba module:
Private Sub IssueNo_Click()
Me.ClaimNo = Nz(DMax("ClaimNo", "ClaimData"), 0) + 1
End Sub
to automatically increment IssueNo by 1, it can only give me 200 +1. If I am filtered on a client that the next issue is 16, the next number I get is 201.
Any thoughts on how I could make it look for the highest number inside of the forms filtered parameters and stay within the correct AuditCode from AuditData?
Thanks, any help will be appreciated
I am somewhat new to Access code. I am trying to make a number field in a table default to the highest number in that table plus 1 within a given client.
I have a table (named ClaimData) that I input data through a form which gets filtered by an After Update, Event Procedure macro via an unbound combobox (AuditCode) to the client I am currently working on (table AuditData is the list of all Clients).
When I identify an issue for a client, I enter the new information in ClaimData and I assign it a claim number (ClaimNo). Each client may have anywhere from 15 claims to 200 claims. When I use the below code in On Click, Event Procedure in a vba module:
Private Sub IssueNo_Click()
Me.ClaimNo = Nz(DMax("ClaimNo", "ClaimData"), 0) + 1
End Sub
to automatically increment IssueNo by 1, it can only give me 200 +1. If I am filtered on a client that the next issue is 16, the next number I get is 201.
Any thoughts on how I could make it look for the highest number inside of the forms filtered parameters and stay within the correct AuditCode from AuditData?
Thanks, any help will be appreciated