K
kidkosmo2
Ok...here's what I'm trying to acheive:
I am trying to create a form which will calculate who's signature is
required based on several criteria. The three cases for the
signatures are:
District Sales Manager (DSM) only
DSM & Managing Director (MD)
DSM, MD, & Sales Director (SD)
There are three factors used to determine the required signatures.
So, there are three text boxes on my form. I have named those
controls as follows:
txtCM (Contribution Margin) [intCM]
txtRV (Revenue) [intRV]
txtCst (Cost) [intCST]
And here are the different scenarios:
1. If intCM > 30 and intRV > $5000 then DSM Only
2. If intCM > 30 and intRV < $5000 and intCST <$10000 then DSM Only
3. If intCM > 30 and intRV < $5000 and intCST >$10000 then DSM & MD
4. If intCM >0 but <30, intRV > $5000, and intCST < $5000 then DSM
Only
5. If intCM >0 but <30, intRV > $5000, and intCST > $5000 then DSM &
MD
6. If intCM >0 but <30, intRV < $5000, and intCST < $5000 then DSM
Only
7. If intCM >0 but <30, intRV < $5000, and intCST > $5000 then DSM &
MD
8. If intCM < 0 (negative margin) then DSM, MD, & SD
My idea was to create a command button that will create an index
number based on each scenario which will return the same value for the
signature(s) required. For instance:
Scenario 1, 2, 4, & 6 return one value which I can then assign as DSM
Only
Scenario 3, 5, & 7 return one value which I can then assign as DSM &
MD
and, of course #8 stands alone with another value for all three
signatures.
I've tried a variety of If..Then statements to assign different
indexes to each criteria such as:
If intCM > 30 then
intCMIndex=5 (as an example)
Elseif intCM < 0 then
intCMIndex=1
Else
intCMIndex=3
End if
and so on for the other two values and then a final index of:
intSigIndex = intCMIndex + intRVIndex + intCSTIndex
But I can figure out how to get them to add up to a single value to
represent each of the signature scenarios (perhaps this would be a
good question for my old Calculus professor...I didn't do so great in
that class). Plus I just think there's got to be a better way! I'm
thinking a series of CASE statements would work better, but I don't
have any experience working with those.
I apologive for the extensive post. Any help would be appreciated!
I am trying to create a form which will calculate who's signature is
required based on several criteria. The three cases for the
signatures are:
District Sales Manager (DSM) only
DSM & Managing Director (MD)
DSM, MD, & Sales Director (SD)
There are three factors used to determine the required signatures.
So, there are three text boxes on my form. I have named those
controls as follows:
txtCM (Contribution Margin) [intCM]
txtRV (Revenue) [intRV]
txtCst (Cost) [intCST]
And here are the different scenarios:
1. If intCM > 30 and intRV > $5000 then DSM Only
2. If intCM > 30 and intRV < $5000 and intCST <$10000 then DSM Only
3. If intCM > 30 and intRV < $5000 and intCST >$10000 then DSM & MD
4. If intCM >0 but <30, intRV > $5000, and intCST < $5000 then DSM
Only
5. If intCM >0 but <30, intRV > $5000, and intCST > $5000 then DSM &
MD
6. If intCM >0 but <30, intRV < $5000, and intCST < $5000 then DSM
Only
7. If intCM >0 but <30, intRV < $5000, and intCST > $5000 then DSM &
MD
8. If intCM < 0 (negative margin) then DSM, MD, & SD
My idea was to create a command button that will create an index
number based on each scenario which will return the same value for the
signature(s) required. For instance:
Scenario 1, 2, 4, & 6 return one value which I can then assign as DSM
Only
Scenario 3, 5, & 7 return one value which I can then assign as DSM &
MD
and, of course #8 stands alone with another value for all three
signatures.
I've tried a variety of If..Then statements to assign different
indexes to each criteria such as:
If intCM > 30 then
intCMIndex=5 (as an example)
Elseif intCM < 0 then
intCMIndex=1
Else
intCMIndex=3
End if
and so on for the other two values and then a final index of:
intSigIndex = intCMIndex + intRVIndex + intCSTIndex
But I can figure out how to get them to add up to a single value to
represent each of the signature scenarios (perhaps this would be a
good question for my old Calculus professor...I didn't do so great in
that class). Plus I just think there's got to be a better way! I'm
thinking a series of CASE statements would work better, but I don't
have any experience working with those.
I apologive for the extensive post. Any help would be appreciated!