On Wed, Sep 15, 2010 at 3:22 PM, Peter Hart
<[email protected]> wrote:
> Hi Ted
>
> Spot on thank you.
>
> Took a bit of working out as to what all the constants were for thanks to the 
> Object Browse but now working fine
>
> With ThisForm.oleControl1
>        Do Case
>                Case Thisform.nReturn = 3 && Largest
>                        .ExecWB(19,2,4,.Null.)
>                Case Thisform.nReturn = 4 && Larger
>                        .ExecWB(19,2,3,.Null.)
>                Case Thisform.nReturn = 5 && Medium
>                        .ExecWB(19,2,2,.Null.)
>                Case Thisform.nReturn = 6 && Smaller
>                        .ExecWB(19,2,1,.Null.)
>                Case Thisform.nReturn = 7 && Smallest
>                        .ExecWB(19,2,0,.Null.)
>        Endcase
> EndWith

Glad that worked for you. You might want to simplify the code by using
a few constants for your magic numbers (as useful as comments!), and
simplifying the math:

#DEFINE SomeConstant 19
#DEFINE SomeOtherConstant 2
#DEFINE YetAnother NULL
nResult = 7 -Thisform.nReturn

if nResult >= 0 and <= 4
   .ExecWB(SomeConstant, SomeOtherConstant, nResult, YetAnother)
endif


-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to