Multiple IFs in VBA - Help writing code please

L

Lori

Okay, hopefully this is simple. I am using two pictures on a form that fill
a void when a subform is empty. I have the properties set to visible=no and
an event set up "on activate": If me.otherexpenses=0 then
me.other-excel.visible=true. This works beautifully, however, I have two
pictures. I've tried to set the code in "on open" but I get an error stating
that there is no value in the "otherexpenses" field.

How would write the code so that it will look at the "otherexpenses" and
"businesstotal"?

All help is definitely appreciated.
 
D

Duane Hookom

Since this is a Report news group, I would suggest you add code to the On
Format event of the section containing the images and the bound controls.
"OtherExpenses" must be bound to a control in the section in order for the
code to work.
 
L

Lori

that's the strange part. Either one will work fine in the "on activate"
event. So the format for both the otherexpenses and the businesstotal. My
question is how can I write this "on activate" so that it will basically do
this:

If me.otherexpenses = 0 then
me.other-excel.visible = true
AND
If me.businesstotal = 0 then
me.bus-excel.visible = true
 

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