restrict number upto 7

Posted on 2011-11-01
Last Modified: 2012-05-12
 Dim tildays As Decimal = dateallreadybooked.counttilleft(Session("Username"))

        While tildays > 0
            DropDownList1.Items.Add(New ListItem(tildays, tildays))

            tildays -= 0.5
        End While

Open in new window

How would i edit the code so the drop down menu will only reach 7

so if tildays = 58 then it will only go upto 7

if till days = 5 it will still show only 5
Question by:runnerjp2005
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    While tildays > 0 AndAlso tildays <= 7

    Open in new window

    LVL 74

    Accepted Solution

    Actually, let me change that:

    If tildays > 7 Then tildays = 7
    While tildays > 0

    Open in new window


    Author Closing Comment

    Thats great,,,, i would have never of thought of that logic!
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    NP. Glad to help  = )

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now