C
Colin Foster
Hi,
I need to set up a conditional macro to help do the following:
If someone works in the Accounts department (AC01), their salary needs to be
in the range 10,000 - 30,000
If they work in the QC department, their salary needs to be 4,000 - 25,000
Anyone else can have any salary.
I also need to prompt with appropriate messages explaining what are
acceptable salaries for the department & whether the entered salary is too
high or too low.
So far I have tried this (the comments in the {} are what is in the Action
column, everything else is in the Condition column)...
[Forms]![frm Employees ex3 Mainform]![Department Number] Like "AC01"
.... {Message box explaining salary upper & lower limits}
[Forms]![frm Employees ex3 Mainform]![Salary]<10000 {Message box explaining
too low a level used}
.... {CancelEvent - to stop the low salary being input}
[Forms]![frm Employees ex3 Mainform]![Salary]>30000 {Message box
explaining too high a level used}
.... {CancelEvent - to stop the high salary being input}
[Forms]![frm Employees ex3 Mainform]![Department Number] Like "QC01"
[Forms]![frm Employees ex3 Mainform]![Salary]<4000{Message box explaining
too low a level used}
.... {CancelEvent - to stop the low salary being input}
[Forms]![frm Employees ex3 Mainform]![Salary]>25000 {Message box
explaining too high a level used}
.... {CancelEvent - to stop the low salary being input}
Needless to say, this doesn't work properly!! So any suggestions would be
useful as this is my first attempt at these sort of Macros.
regards
Colin Foster
I need to set up a conditional macro to help do the following:
If someone works in the Accounts department (AC01), their salary needs to be
in the range 10,000 - 30,000
If they work in the QC department, their salary needs to be 4,000 - 25,000
Anyone else can have any salary.
I also need to prompt with appropriate messages explaining what are
acceptable salaries for the department & whether the entered salary is too
high or too low.
So far I have tried this (the comments in the {} are what is in the Action
column, everything else is in the Condition column)...
[Forms]![frm Employees ex3 Mainform]![Department Number] Like "AC01"
.... {Message box explaining salary upper & lower limits}
[Forms]![frm Employees ex3 Mainform]![Salary]<10000 {Message box explaining
too low a level used}
.... {CancelEvent - to stop the low salary being input}
[Forms]![frm Employees ex3 Mainform]![Salary]>30000 {Message box
explaining too high a level used}
.... {CancelEvent - to stop the high salary being input}
[Forms]![frm Employees ex3 Mainform]![Department Number] Like "QC01"
[Forms]![frm Employees ex3 Mainform]![Salary]<4000{Message box explaining
too low a level used}
.... {CancelEvent - to stop the low salary being input}
[Forms]![frm Employees ex3 Mainform]![Salary]>25000 {Message box
explaining too high a level used}
.... {CancelEvent - to stop the low salary being input}
Needless to say, this doesn't work properly!! So any suggestions would be
useful as this is my first attempt at these sort of Macros.
regards
Colin Foster