Hi all,
I have created an unbound form in Access wherein I enter customer names, cities and invoice numbers being sent to them. i also have current date field and customerID fields on the form. Every thing on my form works as per my requirement and without any errors, except for one - the EnvelopeID generation. In the underlying table, EnvelopeID has a data type of "number".
When i open the form today for the very first time, it should automatically assign a new EnvelopeID after checking the largest EnvelopeID number already present in the table. From hereon, there can be multiple invoices being sent to a single customer today, resulting in multiple line entries for that customer in the form for each unique invoice number. However, i want the EnvelopeID to remain the same every time the same customer is entered, but to increment by 1 when i enter a new customers' name.
I am so far thinking about inserting code for this in the "OnLostFocus" event of customer names combo box, so that as soon as i select customer's name and move on to the next entry field, the EnvelopeID code runs and populates the EnvelopeID textbox field. But i am stuck with writing the code for it. I have attached an example Excel file for this purpose.
I'd be grateful for all the help offered.
I have created an unbound form in Access wherein I enter customer names, cities and invoice numbers being sent to them. i also have current date field and customerID fields on the form. Every thing on my form works as per my requirement and without any errors, except for one - the EnvelopeID generation. In the underlying table, EnvelopeID has a data type of "number".
When i open the form today for the very first time, it should automatically assign a new EnvelopeID after checking the largest EnvelopeID number already present in the table. From hereon, there can be multiple invoices being sent to a single customer today, resulting in multiple line entries for that customer in the form for each unique invoice number. However, i want the EnvelopeID to remain the same every time the same customer is entered, but to increment by 1 when i enter a new customers' name.
I am so far thinking about inserting code for this in the "OnLostFocus" event of customer names combo box, so that as soon as i select customer's name and move on to the next entry field, the EnvelopeID code runs and populates the EnvelopeID textbox field. But i am stuck with writing the code for it. I have attached an example Excel file for this purpose.
I'd be grateful for all the help offered.