S
Smokeyhavoc
Below is a previous post I did and beyond the second reply I haven't head
anything else on it. I have since changed the master table so that the check
boxes are no longer in the table, they're now an interger reading either "0"
or "-1". Now the master table looks basicly like this:
Pilot ID First Name Last Name Admiistrative Specialist Medic
1 John Doe -1 0
0
2 Sally Smith 0 -1
-1
and so on
the table the those coulms reference to is the Admin Salary table:
Admin ID Admin Position Yearly Salary
1 Admin 12000
2 Specialist 14500
3 Medic 15000
The equasion i need is this:
Modified Salary + 1/2 of true arguments
now what I was thinking the string should look like is something like this:
sub AdminMod (IIf
![Mechwarrior Table]![Administrative]=true
then [query]![Mechwarrior Salary]![Salary]+
![Admin Salary]![Yearly
Salary]/2
end sub
The problem with that is that more than one can apply, like Admin and
Specialist, or Medic and Specialist, or even all three. Which is why I chose
to use checkboxes.
:
You need to not be using checkboxes but a field to contain 'AdminID' then
you can left join the two tables in your query.
IIF([AdminID] Between 1 AND 3, ([Base salary] * [skill multiplier] * [Rank
multiplier]) + ([Yearly Salary]/2), ([Base salary] * [skill multiplier] *
[Rank multiplier]) = modified salary
--
KARL DEWEY
Build a little - Test a little
:
ok the checkboxes are in the master table. the three checkboxes are:
anything else on it. I have since changed the master table so that the check
boxes are no longer in the table, they're now an interger reading either "0"
or "-1". Now the master table looks basicly like this:
Pilot ID First Name Last Name Admiistrative Specialist Medic
1 John Doe -1 0
0
2 Sally Smith 0 -1
-1
and so on
the table the those coulms reference to is the Admin Salary table:
Admin ID Admin Position Yearly Salary
1 Admin 12000
2 Specialist 14500
3 Medic 15000
The equasion i need is this:
Modified Salary + 1/2 of true arguments
now what I was thinking the string should look like is something like this:
sub AdminMod (IIf
then [query]![Mechwarrior Salary]![Salary]+
Salary]/2
end sub
The problem with that is that more than one can apply, like Admin and
Specialist, or Medic and Specialist, or even all three. Which is why I chose
to use checkboxes.
:
You need to not be using checkboxes but a field to contain 'AdminID' then
you can left join the two tables in your query.
IIF([AdminID] Between 1 AND 3, ([Base salary] * [skill multiplier] * [Rank
multiplier]) + ([Yearly Salary]/2), ([Base salary] * [skill multiplier] *
[Rank multiplier]) = modified salary
--
KARL DEWEY
Build a little - Test a little
:
ok the checkboxes are in the master table. the three checkboxes are:
Admin, Specialist, and Medic,
now the first part of the equasion is working:
Base salary * skill multiplier * Rank multiplier = modified salary
now for the second part:
when a checkbox is checked it has to go to another table named Admin Salary,
the table looks like this:
Admin ID Admin Position Yearly Salary
1 Admin 12000
2 Specialist 14500
3 Medic 15000
then it takes the corresponding salary and adds 1/2 to the modified salary
from above
KARL DEWEY said:Now there are three check boxes on the main table.
Proper phrasing check boxes are IN a table and are ON a form. Are they in a
table?
What are the names of your fields?
Try this substituting your checkbox name for Checkbox1, etc.
IIF([Checkbox1]=-1,[Base salary] *1.5, [Base salary]) *
IIF([Checkbox2]=-1,[skill multiplier] *1.5, [skill multiplier]) *
IIF([Checkbox3]=-1,[Rank multiplier] *1.5, [Rank multiplier]) = modified
salary
--
KARL DEWEY
Build a little - Test a little
:
ok here goes,
I have a formula that I need a query to complete. The way I have my tables
set up is that the values are on refernce tables and the ID # is on the main
table, which from what I understand is the way it should be. Now there are
three check boxes on the main table. I can get the first half of the equasion
to work, where the ID#'s are used. What I can't get to work are the check box
values.
Now, the equasion I have so far is this:
Base salary * skill multiplier * Rank multiplier = modified salary
This is working just fine.
here's the trickey part:
IF the checkboxes are checked then I need it to add 1/2 of the corresponding
field.
I don't know how to associate the record on the table with the checkbox in
order to add it in to the equasion