Hi everyone,
I've got the following issue:
I'm building a database with a invoice part, the orders are collected into 1 invoice per customer.
The view is all the records listed beneath each other.
Customer1 - 2008010101
Customer1 - 2008010101
Customer1 - 2008010101
Customer2 - 2008010102
Customer2 - 2008010102
Customer2
Customer3
Customer3
When I enter the field with tab the highest number is listed (Dmax function) what I want to create is that on every change of customer the invoice number is automatically adjusted with 1 instead of manually adjusting the number for a couple of records before adjusting it again.
I've tried some VBA coding but i'm not very good at it:
Code:
End SubAny help is welcome, thanks in advance.
I've got the following issue:
I'm building a database with a invoice part, the orders are collected into 1 invoice per customer.
The view is all the records listed beneath each other.
Customer1 - 2008010101
Customer1 - 2008010101
Customer1 - 2008010101
Customer2 - 2008010102
Customer2 - 2008010102
Customer2
Customer3
Customer3
When I enter the field with tab the highest number is listed (Dmax function) what I want to create is that on every change of customer the invoice number is automatically adjusted with 1 instead of manually adjusting the number for a couple of records before adjusting it again.
I've tried some VBA coding but i'm not very good at it:
Code:
Code:
Dim StrVestiging As String
StrVestiging = Value
Dim StrValue As String
StrValue = DMin("[txt_Vestiging]", "klantgegevens1")
StrVestiging = -StrValue = StrNumber
'Factuurnummer = DMax("[Factuurnummer]", "klantgegevens1")
Factuurnummer = DMax("[Factuurnummer]", "klantgegevens1") + StrNumber
Factuurnummer = DMax("[Factuurnummer]", "klantgegevens1")
End SubAny help is welcome, thanks in advance.