Ashfaque
Search Beautiful Girls from your town for night
- Local time
- Today, 15:57
- Joined
- Sep 6, 2004
- Messages
- 897
Hi,
On my invoice header form, I am selecting new customer from a combo that brings customer name and customer code in diff text boxes on the form.
A field called SalesInvNum is field that generate invoice number in below manner.
Example if the Customer is Peter and his code is 102 then SalesInvNum will have
Pe-100509-102-2
Pe = first 2 characters of the customername field on form
100509 = is current date
102= is customer code that picked up from CustomerCode field on form
2= is the highest number of invoice of particular customer.
On after update of CboSelectCustomer, I have below code that generates the above invoice format.
Me.SalesInvNum = Mid(CustomerName, 1, 2) & "-" & Format(InvDate, "YYMMDD") & "-" & Me.CustomerCode & "-"
What I am looking for is like this, when the user creates new invoice and select new customer from CboSelectCustomer, the textbox SalesInvNum should bring last (max) invoice number of that customer on that day.
Let us say Peter (code 102) have total 4 invoices on the same date.
Pe-100509-102-1
Pe-100509-102-2
Pe-100509-102-3
Pe-100509-102-4
And when user click to add new invoice for the same customer in the same date it should add + 1 to last number of his invoice so it will be
Pe-100509-102-5
To see what is the last invoice for this customer in the same date for same customer, I placed one text box on form that will display last invoice for this customer .To do this I tried this way but no use.
Me.Text118 = DMax("SalesInvNum", "T_SalesInvHead", "CustomerName='" & CustomerName & "' And CustomerCode=" & CustomerCode)
Can anyone help me out.
Thanks,
On my invoice header form, I am selecting new customer from a combo that brings customer name and customer code in diff text boxes on the form.
A field called SalesInvNum is field that generate invoice number in below manner.
Example if the Customer is Peter and his code is 102 then SalesInvNum will have
Pe-100509-102-2
Pe = first 2 characters of the customername field on form
100509 = is current date
102= is customer code that picked up from CustomerCode field on form
2= is the highest number of invoice of particular customer.
On after update of CboSelectCustomer, I have below code that generates the above invoice format.
Me.SalesInvNum = Mid(CustomerName, 1, 2) & "-" & Format(InvDate, "YYMMDD") & "-" & Me.CustomerCode & "-"
What I am looking for is like this, when the user creates new invoice and select new customer from CboSelectCustomer, the textbox SalesInvNum should bring last (max) invoice number of that customer on that day.
Let us say Peter (code 102) have total 4 invoices on the same date.
Pe-100509-102-1
Pe-100509-102-2
Pe-100509-102-3
Pe-100509-102-4
And when user click to add new invoice for the same customer in the same date it should add + 1 to last number of his invoice so it will be
Pe-100509-102-5
To see what is the last invoice for this customer in the same date for same customer, I placed one text box on form that will display last invoice for this customer .To do this I tried this way but no use.
Me.Text118 = DMax("SalesInvNum", "T_SalesInvHead", "CustomerName='" & CustomerName & "' And CustomerCode=" & CustomerCode)
Can anyone help me out.
Thanks,