Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 132,210 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 918 people online right now. Registration is fast and FREE... Join Now!




combo box

 
Reply to this topicStart new topic

combo box

emkaye
post 21 Feb, 2008 - 03:42 AM
Post #1


D.I.C Head

**
Joined: 12 Aug, 2007
Posts: 53


My Contributions


I have a combo box named cboDepYear

I wanted to know how to list continous year from year 2000 to the present year in a combo box. Please check the scenario below:

say for example, we were already in the year 2008 on the month of December. As for now, I wanted to have cboDepYear list year 2008. When January 1, 2009 comes. I want it to automatically add year 2009 in the list.

Sorry, I haven't started a code for it because I'm working out on a much bigger function of the airline reservation system I am developing. I hope you understand and you would still reply.

And one thing more. I just wanted to know if it is possible to list a complete date (ex. January 1, 2008 until January 31, 2008) in a combo box?

Thanks!

smile.gif




User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 21 Feb, 2008 - 05:25 AM
Post #2


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,923



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks smile.gif

Given that, here is a small nudge. You're going to want to use the Year function, along with the current date, in a loop, to do this. Read up on that function, give it a shot, it's a whole lot easier than you think, then if you run into problems post the offending code (in code tags of course) and we will help as much as we can smile.gif
User is online!Profile CardPM

Go to the top of the page

PsychoCoder
post 21 Feb, 2008 - 01:26 PM
Post #3


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,923



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


emkaye,

I wrote a snippet that covers exactly what you're looking for. It is well commented and explains how it works. Take a look, this should solve your problem smile.gif

Happy Coding!
User is online!Profile CardPM

Go to the top of the page

emkaye
post 22 Feb, 2008 - 05:08 AM
Post #4


D.I.C Head

**
Joined: 12 Aug, 2007
Posts: 53


My Contributions


thanks it's really a big help. I really wanted to post my code here, only if i really have an ample of time. I'm really have deadlines to meet. don't worry i still post my codes with other topics i already posted here.

thanks for the help anyways!

smile.gif
User is offlineProfile CardPM

Go to the top of the page

LookNAO
post 22 Feb, 2008 - 05:53 AM
Post #5


D.I.C Head

**
Joined: 28 Dec, 2007
Posts: 66



Thanked 1 times
My Contributions


Psycho... Nice code! :-)
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 22 Feb, 2008 - 06:01 AM
Post #6


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,923



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Thanks LookNAO smile.gif
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 08:01PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month