473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Combo Box to List all Future Dates

92
How Do,

Is there any way to get a drop down menu to show all dates into the future, without entering them into a table beforehand?

I really don't want to use the calendar control, but I need to be able to enter any date in the future.

Cheers,

NDayave
Nov 24 '08 #1
3 2628
missinglinq
3,532 Expert 2GB
You wouldn't want all future dates listed; the combobox would never finish loading! This example lists the current date and 120 days in the future. You can modify number in this line:

For D = 1 To 121

to adjust how many future dates are displayed. Replace cboPickDate with your combobox name.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3. Me.cboPickDate.RowSourceType = "Value List"
  4.  
  5. Me.cboPickDate.RowSource = Date
  6.  
  7. For D = 1 To 121
  8.   Me.cboPickDate.RowSource = Me.cboPickDate.RowSource & ";" & Date + D
  9. Next D
  10.  
  11. End Sub
Linq ;0)>
Nov 24 '08 #2
FishVal
2,653 Expert 2GB
Hello, NDayave.

As an addition to Linq's suggestion.

In this thread you could find an attachment with a pure SQL method to generate sequential dates list.

Regards,
Fish
Nov 24 '08 #3
NDayave
92
Cheers, works a treat.

Just need to format the date to the correct format dd/mm/yyyy and I'm away.
Dec 2 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Andrew Parsons | last post by:
Apologies if this is an old chestnut, but I can't find an answer anywhere! I have a form which has a button which opens a report. This all works perfectly well. However, I am trying to set up a...
1
by: Aravind | last post by:
Hi folks. My database project has the following: -------------------------------------------------------------------------------- tables: Member: MemName, MemNo , MemType, CourseFaculty...
7
by: MLH | last post by:
On July 5th, Jim Fortune contributed the SQL shown below. Its a neat solution. Original thread was entitled "sql for an A97 query that'll return 6 future consecutive dates 20-25 days from now" ...
4
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2)...
2
by: MobiusDick | last post by:
Hi All, I'm in the process of creating a database that allows users to enter details into a form which includes a date range as start and end dates. I have used the inbuilt Calendar Control...
10
AllusiveKitten
by: AllusiveKitten | last post by:
Hi I am hoping someone can help me, I have a form with two combo boxes in it.... The first combo box gets its values from a table via an SQL query in the combo box properties. The second combo...
7
by: clarencelai | last post by:
Hi.. I need to run some monthly reports that requires the user to pick a date (MMM-YYYY) from a drop down list. How can I list the dates (MMM-YYYY) in the combo box such that it would...
4
by: novoselent | last post by:
This seems like it should be an easy thing, but I think I'm missing something simple here...or I'm just going about it all wrong... Using Access 2003 I have a form that lists vehicle service...
8
by: troy_lee | last post by:
I want to look at the values of six combo boxes. If any of the boxes are not null, I want to change the value of a separate text box. How can I look at all of them at once? Thanks in advance. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.