Minggu, 22 Mei 2011

RE: [MS_AccessPros] Needs help in logic VBA Code

 

Hi MEL

First, assume var1 is both the largest and the smallest:

largest = var1
smallest = var1

Then test the other two to see if they are larger/smaller:

If var2 > largest Then largest = var2
If var2 < smallest Then smallest = var2
If var3 > largest Then largest = var3
If var3 < smallest Then smallest = var3

If the values were in an array then it would be easy to implement this in a
small loop.

Good luck :-)
Graham

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of MEL
Sent: Monday, 23 May 2011 11:09
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Needs help in logic VBA Code

Hi guys: Can any one please help me in the logic using vba code. I have 3
numbers in three variables. How to find the largest and the smallest number
in them
assume var1=2, var2=1, var3=7largest=?smallest=?
Thanks.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar