Hello again Carmen,
hmmm...Are these human generated numbers guaranteed to be unique? Do you allow the user to change (or correct) the order number after they have finished entering the order? You are forced to query the order table to see if it has been used before, and cascade-update the lines if they change it. If you add an orderID (auto generated) field as the primary key, you can keep it invisible to the user, and still let them enter their own order number to keep themselves happy.
But, I would also be incorporating some customer training and questioning into the mix, to find out why they really need this. Perhaps they really need the system to provide some other information, and are using this "feature" to compensate. Anyway, these are just some of my thoughts on the issue :)
BTW, returning zero (instead of .f.) from valid() will prevent VFP from showing the user an annoying "Invalid Input" window.
>Hi Steve,
> In a perfect world, yes the system should genereate the number, I agree. Some clients, however, use part of their customer p.o. number as part of their order number and just want the flexibility to come up with meaningful order numbers. Some of these are alphanumeric some entirely alpha and so on. I feel if they are paying the freight, they can have what they want. As far as the fields being filled in in any order, again, I agree, but I was looking to streamline as much as possible. This form is based on an existing Clipper application so I was trying for as much emulation of input as I could get. Good observations, thank you.
>
Steve Gibson