Thread: Maximum value

    #1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2012
    Posts
    12
    Rep Power
    0

    Maximum value


    i have four textboxes and one checkbox. how will i state in vba that if the checkbox is checked the fourth textbox will show the value of the third textbox, otherwise it will show the maximum or highest value of the first three textboxes?
  2. #2
  3. Moderator
    ASP Super Genius (4500 - 4999 posts)

    Join Date
    Apr 2009
    Location
    The Great Land
    Posts
    4,628
    Rep Power
    654
    Something like:

    If Me.check Then
    Me.text4 = Me.text3
    ElseIf Me.text1 => Me.text2 And Me.text1 => Me.text3 Then
    Me.text4 = Me.text1
    ElseIf Me.text2 => Me.text3 Then
    Me.text4 = Me.text2
    Else
    Me.text4 = Me.text3
    End If
    I like to know if my suggestion helped you. One way to let me know is by clicking star at bottom left corner of post.
    Debug!Debug!Debug!http://www.cpearson.com/excel/debug.htm
  4. #3
  5. ASP Hero (2000 - 2499 posts)

    Join Date
    Jun 2006
    Location
    New Springfield, OH
    Posts
    2,045
    Rep Power
    1056
    Originally Posted by June7
    Something like:

    If Me.check Then
    Me.text4 = Me.text3
    ElseIf Me.text1 => Me.text2 And Me.text1 => Me.text3 Then
    Me.text4 = Me.text1
    ElseIf Me.text2 => Me.text3 Then
    Me.text4 = Me.text2
    Else
    Me.text4 = Me.text3
    End If
    Along the same lines...
    Code:
    If Me.check Then
        Me.text4 = Me.text3
    Else
        Me.text4 = Me.text1
        If Me.text2 > Me.text1 Then
            Me.text4 = Me.text2
        End If
        If Me.text3 > Me.text1 Then
            Me.text4 = Me.text3
        End If
    End If
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!!

Similar Threads

  1. How to get the maximum number of an array column?
    By zwieback89 in forum ASP Development
    Replies: 4
    Last Post: December 29th, 2006, 11:45 AM
  2. Maximum ??
    By danasegarane76 in forum Microsoft SQL Server
    Replies: 1
    Last Post: July 28th, 2006, 05:24 AM
  3. Upload Image Maximum Size
    By umeshk in forum ASP Development
    Replies: 2
    Last Post: January 13th, 2005, 07:33 AM
  4. Maximum length is 128??
    By nofriends in forum ASP Development
    Replies: 13
    Last Post: December 24th, 2004, 02:47 PM
  5. ASP Script Timeout Maximum
    By hominamad in forum Microsoft IIS
    Replies: 4
    Last Post: February 5th, 2004, 08:06 AM

IMN logo majestic logo threadwatch logo seochat tools logo