Option Grp and Field If statement

R

RFrechette

I apologize. I accidently posted this in the Modules forum first.

I have a form called "frm_Credits". I have an option group called
"Frame_Credit". Within this group are 4 options. They populate the "Credit"
field. I also have a field called "Units". What I need to do is go through
a series of scenarios that could occur and perform an action for each one.
This is what I have for code and I put it after updating the "Units" field
and also after updating the Option Group. After updating either one of these
fields, nothing happens.

If I take out the "And Credit...", it works for the "Units" value.

I tried using a Case statement and apparently didn't get the syntax correct.

Any help would be so much appreciated.

If Credit = "1" And Units < 0 Then 'Credit and amount is negative
Units = Units
ElseIf Credit = "1" And Units > 0 Then 'Credit and amount is positive
Units = Units * -1
ElseIf Units < 0 And Frame_Credit = "2" Then 'Credit and amount is
negative
Units = Units
ElseIf Units > 0 And Frame_Credit = "2" Then 'Credit and amount is
positive
Units = Units * -1
ElseIf Units < 0 And Frame_Credit = "3" Then 'Rebill and amount is
negative
Units = Units
ElseIf Units > 0 And Frame_Credit = "3" Then 'Rebill and amount is
positive
Units = Units * -1
ElseIf Units < 0 And Frame_Credit = "4" Then 'Rebill and amount is
negative
Units = Units
ElseIf Units > 0 And Frame_Credit = "4" Then 'Rebill and amount is
positive
Units = Units * -1
End If

Thanks,
Rachel
 
R

RFrechette

Please ignore this post. I thought I posted in Modules by mistake, but I
posted it in Programming.

Sorry.
 

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