restrict number upto 7

Posted on 2011-11-01
Medium Priority
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
  • 3
LVL 75

Expert Comment

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

Open in new window

LVL 75

Accepted Solution

käµfm³d   👽 earned 2000 total points
ID: 37062228
Actually, let me change that:

If tildays > 7 Then tildays = 7

While tildays > 0

Open in new window


Author Closing Comment

ID: 37062432
Thats great,,,, i would have never of thought of that logic!
LVL 75

Expert Comment

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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline
Suggested Courses

807 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