Allocation to autonumber

swee

Registered User.
Local time
Yesterday, 19:06
Joined
Aug 11, 2004
Messages
66
I have a combo box that has two choices, OutletA and OutletB. When the user chooses one of the outlets, i want a textfield to be filled automatically. For example, if the user chooses OutletA, I want the textfield to display A1; whereas if the user chooses OutletB, the textfield will display B1.

The next form will then display A2 or B2 depending on the choice of the outlet chosen. Can the textfield be of AutoNumber property and if so, how do I add "A" or "B" to the front of the field?

Regards,
Swee
 
The purpose of adding an alphabet to the front of the autonumber is to allow for easy searching and filtering. With the alphabet, I would be able to classify which orders come under OutletA and which come under OutletB.

I was thinking of doing something like this:
=====================================

If (comboOutlet = OutletA)
txtPONum.text = "comboOutlet.Column(1)" + FindtheLastPONumUsedByOutletA

=====================================

The problem is that I'm not sure how am I able to find the last PONum used by OutletA or OutletB. OutletA and OutletB should have their individual records of PONum. Can this be done using DMax and if so, how do I do it?

Thanks,
Swee
 
How do I get the last PONumber + 1? For example, there are 4 purchase orders for OutletA and 3 purchase orders for OutletB currently. The next purchase order for OutletA and OutletB will be 5 and 4 respectively. Thus, I would want the textfield to display A5 and B4, whichever outlet is chosen in the form.
 

Users who are viewing this thread

Back
Top Bottom