field value based on other fields in form.

smitty27629

Registered User.
Local time
Today, 01:37
Joined
Jul 27, 2004
Messages
12
I have a scenario like the following:

field1 field2 field3 field4 field5

field5's control source is: =[field1]/[field3]

The problem is that, it is possible that both field1 and field3 can be 0. I would like to set field5 to 0 if field1 or field3 are not >0. I just cannot figure out the code for that. Could someone please help, tutorial, code sample, documentation, something. Thanks in advance.

Sean
 
smitty,

New ControlSource:

=IIf([field1] <= 0 Or [field3] <= 0, 0, [field1]/[field3])

Wayne
 
Wayne,

Sorry it has taken so long to respond. It worked wonderfully. Thank you very much.

Everyone, can you recommend a good book, website, etc. For VBA in Access. Most everything I find in searchess is for Excel. Thank you all.
 
Smitty,

Glad to hear it. Don't know if there's a good book. You can use the search
facility here and look for books (Watercooler forum "books").

But if you peruse the VBA forum, you'll see some examples of how and
when (even When not to use) VBA.

Wayne
 

Users who are viewing this thread

Back
Top Bottom