if then and

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.
 
D

Dirk Goldgar

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?
 

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