Code Comments
Programming Forum and web based access to our favorite programming groups.Hi everyone, I'm designing an application which requires me to have a combo box drop down list that has in it a list of previous 100 years, from 1900 to 2000. Now although I could just manually type them in, I would like the application to automatically update itself as the years go by. Is there a solution to this issue? If so, how. Please advise. I'd greatly appreciate. Thanks in advance
Post Follow-up to this message> Hi everyone, I'm designing an application which requires me to have a combo > box drop down list that has in it a list of previous 100 years, from 1900 to > 2000. Now although I could just manually type them in, I would like the > application to automatically update itself as the years go by. Is there a > solution to this issue? If so, how. Please advise. If you want the ComboBox to have the 100 years from 1900 to 2000 (which is actually 101 years by the way) and the current year is 2005, what do you mean by "I would like the application to automatically update itself as the years go by"? What was different about the last 5 years that you didn't want an automatic update to take place? As for putting the years 1900 to 2000 into a ComboBox (assumed to be named Combo1) Dim X As Long Combo1.Clear For X = 1900 To 2000 Combo1.AddItem CStr(X) Next Rick - MVP
Post Follow-up to this messageRick Rothstein wrote: > > If you want the ComboBox to have the 100 years from 1900 to 2000 > (which is actually 101 years by the way) and the current year is > 2005, what do you mean by "I would like the application to > automatically update itself as the years go by"? What was different > about the last 5 years that you didn't want an automatic update to > take place? Perhaps what he means is that as each year goes by, one year is dropped off and the next added. In which case, change the following line: - > As for putting the years 1900 to 2000 into a ComboBox (assumed to be > named Combo1) > > Dim X As Long > Combo1.Clear For X = Year(Now)-100 to Year(Now) > Combo1.AddItem CStr(X) > Next > > Rick - MVP -- Regards, Michael Cole
Post Follow-up to this messageGreat, thanks a lot guys. I'm sorry for the little confusion. What Michael assumed is exactly what I meant. When the customer information is filled in, clerk will choose from a list of "Years", the year of birth. And as the year s go by, 1 year is dropped. I decided to keep 100 years in there, just in case . =) Thanks again.... "Michael Cole" wrote: > Rick Rothstein wrote: > > Perhaps what he means is that as each year goes by, one year is dropped of f > and the next added. > > In which case, change the following line: - > > > For X = Year(Now)-100 to Year(Now) > > > -- > Regards, > > Michael Cole > > >
Post Follow-up to this messageCan't see the point. If the combobox list is from 1900 to 2000 (or 1906-2005 in 2005), then by th e time you move the cursor to 1947 (when I was born) and select it, it would be quicker to have typed "1947" into a tex t box!! Even if you make it a drop-down box, you'd still be typing it in (Even quicker - "47" and add a bit of code to pick up the century - after al l, you're limiting it to 100 years) And what if you DID have someone older than 100 years? (Yeah, I know, ...... sigh .......... have another combobox) Ummmm.... Just attracting arrows - don't take me too seriously :-> Argusy Ricky wrote: > Great, thanks a lot guys. I'm sorry for the little confusion. What Michael > assumed is exactly what I meant. When the customer information is filled i n, > clerk will choose from a list of "Years", the year of birth. And as the ye ars > go by, 1 year is dropped. I decided to keep 100 years in there, just in ca se. > =) > > Thanks again.... > > "Michael Cole" wrote: > > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.