HELP with IF statement...

  • Thread starter Newf via AccessMonster.com
  • Start date
N

Newf via AccessMonster.com

Good day! I have this If statement calculation that I am trying to place in
the Control Source of a text box (rpt_txt_Fed_Tax) on my Report. This is the
If statement:

If txt_RRSP <> 0 Then
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * 0
Else
If frm_cmb_Province = "QC" Then
If rpt_txt_ROEC > 5000 Then
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * .10
Else
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * .05
Endif
Else
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * .10
Endif
Endif

This is what I tried and it is not working.

=IIf([txt_RRSP] <> 0, [rpt_txt_Tot_REOC] * 0, IIf([frm_cmb_Province] = â€QCâ€,
IIf([rpt_txt_ROEC] > 5000, [rpt_txt_Tot_Roec] * .10, [rpt_txt_Tot_Roec]*.05,
[rpt_txt_Tot_ROEC] * .1)))


Now I have this one completed and it works fine:

If frm_txt_RRSP <> 0 Then
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * 0
Else
If frm_cmb_Province = "QC" Then
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * .16
Else
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * 0
Endif
Endif


=IIf([txt_RRSP] <> 0,0,IIf([cmb_Province]="QC",([rpt_txt_Totals]*0.16,0))

I HOPE someone can see my problem.
 
N

Newf via AccessMonster.com

Oopppsss.. I had a mistake on the 2nd one that worked

Now I have this one completed and it works fine:

If frm_txt_RRSP <> 0 Then
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * 0
Else
If frm_cmb_Province = "QC" Then
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * .16
Else
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * 0
Endif
Endif

=IIf([txt_RRSP] <> 0,0,IIf([cmb_Province]="QC",([rpt_txt_Totals]*0.16,0)))

Good day! I have this If statement calculation that I am trying to place in
the Control Source of a text box (rpt_txt_Fed_Tax) on my Report. This is the
If statement:

If txt_RRSP <> 0 Then
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * 0
Else
If frm_cmb_Province = "QC" Then
If rpt_txt_ROEC > 5000 Then
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * .10
Else
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * .05
Endif
Else
rpt_txt_Fed_Tax = rpt_txt_Tot_ROEC * .10
Endif
Endif

This is what I tried and it is not working.

=IIf([txt_RRSP] <> 0, [rpt_txt_Tot_REOC] * 0, IIf([frm_cmb_Province] = â€QCâ€,
IIf([rpt_txt_ROEC] > 5000, [rpt_txt_Tot_Roec] * .10, [rpt_txt_Tot_Roec]*.05,
[rpt_txt_Tot_ROEC] * .1)))

Now I have this one completed and it works fine:

If frm_txt_RRSP <> 0 Then
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * 0
Else
If frm_cmb_Province = "QC" Then
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * .16
Else
rpt_txt_Que_Tax = rpt_txt_Tot_ROEC * 0
Endif
Endif

=IIf([txt_RRSP] <> 0,0,IIf([cmb_Province]="QC",([rpt_txt_Totals]*0.16,0))

I HOPE someone can see my problem.
 
J

Jeff L

You need a closing paren after the [rpt_txt_Tot_Roec]*.05 and remove a
closing paren at the very end.

Also, you don't need to multiply by 0. Just set the value to 0.

Hope that helps!
 
N

Newf via AccessMonster.com

Jeff:
YOU ARE AWESOME!!! I've been working on this If statement for 2 weeks and had
to find out how to turn it into those IF statement's.

MERCI BEACOUP!!!!

Newf

Jeff said:
You need a closing paren after the [rpt_txt_Tot_Roec]*.05 and remove a
closing paren at the very end.

Also, you don't need to multiply by 0. Just set the value to 0.

Hope that helps!
Good day! I have this If statement calculation that I am trying to place in
the Control Source of a text box (rpt_txt_Fed_Tax) on my Report. This is the
[quoted text clipped - 35 lines]
I HOPE someone can see my problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top