Validating before submission

tuoggy

Registered User.
Local time
Yesterday, 21:14
Joined
Nov 29, 2007
Messages
17
Okay, I'm sure this is an easy fix. I just can't figure out how to do it.

I have a Job Log database that I created a couple years ago. I have recently been asked to make a few changes to it.

We use this to calculate how much time each employee has spent on a job, as a job log, and also as a way to generate time sheets for technicians.

There are four tables used primarily. The first two are the sales person, and employee tables. The other two are job log and timesheet.

Job log gets the salesperson from the salesperson database.

Here's the question:
On timesheet entry (form) the secretary is required to select a job number from the list, and a salesperson. These each refer back to their respective tables. Is there an easy way to have the form validate that the salesperson entered in the form (from the salesperson table) matches the salesperson on the selected job (on the job log table)?

Thanks for any help.

Oggy
 
I assume your salesperson is already associated with the job?
Then use the after update of the "selected job" to put in the salesperson - take contol away from the secretary
 
Last edited:
Yes, there is a field for salesperson in the Job Log Table.

Having the timesheet entry person enter the salesperson is really just the last line of protection to make sure that it goes to the right person in the end. That's why we don't just print the salesperson from the job log table...
 
Yes, there is a field for salesperson in the Job Log Table.

Having the timesheet entry person enter the salesperson is really just the last line of protection to make sure that it goes to the right person in the end. That's why we don't just print the salesperson from the job log table...

I would then default the value and possibly lock the salesperson control until double clicked to stop them from changing it by mistake
 
i think dcb said it, but to clarify a bit, the salesperson combo should be based on a query that selects only salespeople associated with the selected job. the job must be selected first. on the afterupdate of the job combo, requery the salesperson combo.
 
Wazz - That is in fact my first thought - however I can only assume that this is here in case they need to change it for some reason (not knowing the business variables)

To extend on what Wazz is saying - you could use this as your default query and then have a button that changes the combobox query to open to all salespersons?

More than one way to stop the user from doing the nasty - of course your original thought , validation, is possible however its what you want to do if the validation fails that counts! MsgBoxs saying "You idiot this is not the right salesperson" are often skipped over cause most users in this Microsoft world see so many msgboxs that they skip over them without reading....
 
To extend on what Wazz is saying - you could use this as your default query and then have a button that changes the combobox query to open to all salespersons?
good idea if the person has to be changed.

More than one way to stop the user from doing the nasty - of course your original thought , validation, is possible however its what you want to do if the validation fails that counts! MsgBoxs saying "You idiot this is not the right salesperson" are often skipped over cause most users in this Microsoft world see so many msgboxs that they skip over them without reading....
lol.
 

Users who are viewing this thread

Back
Top Bottom