if then and

  • Thread starter Thread starter Daniel M
  • Start date Start date
D

Daniel M

I am having problems with a if statement.

I would like to make something like If forms!form1!txt01=1 then txt2=5 and
txt3=10. I dont want to have to write 2 if statements. how can i combine it
so that i can have mulitple outputs for a single if statement?

thanks.
 
Daniel M said:
I am having problems with a if statement.

I would like to make something like If forms!form1!txt01=1 then txt2=5 and
txt3=10. I dont want to have to write 2 if statements. how can i combine
it
so that i can have mulitple outputs for a single if statement?


In VBA? You can do a "block If", like this:

If Forms!Form1!txt01=1 Then
txt2=5
txt3=10
End If

Of course, if txt2 and txt3 are controls on the Form1 also, you might need
to qualify them with a reference to the form (unless that's the form where
the code is running). But is the "block If" what you were looking for?
 
Back
Top