AndrewMozley
Programmer
I have become rather confused about validating a field on a data entry form, when the user may divert to another form in the application.
The user is running a form which allows him to enter a (multi-line) purchase invoice and post it to his accounts.
On the header of the form is a text box txtOurRef, which is the invoice reference (usually sequential) which is assigned to that invoice in the purchase ledger. The user may already have a paperwork system where he has already assigned the invoice reference – something like P1056, or (this is a feature of the application) he may just provide a 2-character prefix - say ‘PV’ and the system assigns the next available invoice reference – PV9801 – in the ‘PV’ sequence.
This functionality is provided in the txtOurRef.valid() event. If a full reference is supplied the system checks that this reference has not already been used, and if a 2-character prefix is supplied, the system finds what the next available reference is and displays it (in txtOurRef.value)
However, the user may at any time divert to a different form in the application. He would not do this for frivolous reasons, but he might – for example, if he has not already done so - make an enquiry on the supplier’s account to see what invoices he has already posted.
In this case the txtOurRef.valid() code detects this and abandons the validation. No point in telling the user that he is using an invalid InvRef, when that is what he is about to check up on!
However, when he resumes the original data entry screen it seems to be possible to position anywhere on that form, and so – to bypass the txtOurRef.valid() code.
What do other people feel is the best way of handling this situation (perhaps not ‘Don’t start from there’), but grateful for guidance !
Thanks. Andrew
The user is running a form which allows him to enter a (multi-line) purchase invoice and post it to his accounts.
On the header of the form is a text box txtOurRef, which is the invoice reference (usually sequential) which is assigned to that invoice in the purchase ledger. The user may already have a paperwork system where he has already assigned the invoice reference – something like P1056, or (this is a feature of the application) he may just provide a 2-character prefix - say ‘PV’ and the system assigns the next available invoice reference – PV9801 – in the ‘PV’ sequence.
This functionality is provided in the txtOurRef.valid() event. If a full reference is supplied the system checks that this reference has not already been used, and if a 2-character prefix is supplied, the system finds what the next available reference is and displays it (in txtOurRef.value)
However, the user may at any time divert to a different form in the application. He would not do this for frivolous reasons, but he might – for example, if he has not already done so - make an enquiry on the supplier’s account to see what invoices he has already posted.
In this case the txtOurRef.valid() code detects this and abandons the validation. No point in telling the user that he is using an invalid InvRef, when that is what he is about to check up on!
However, when he resumes the original data entry screen it seems to be possible to position anywhere on that form, and so – to bypass the txtOurRef.valid() code.
What do other people feel is the best way of handling this situation (perhaps not ‘Don’t start from there’), but grateful for guidance !
Thanks. Andrew