Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

date problem

Posted on 2003-03-30
1
Medium Priority
?
126 Views
Last Modified: 2010-05-01
there are 2 combo box

if combo1 select Jan then combo2 show 1 to 31 for choose

if combo1 select Feb then combo2 show 1 to 28 for choose

and so on...

how to do it?
0
Comment
Question by:Barca
1 Comment
 
LVL 14

Accepted Solution

by:
aelatik earned 80 total points
ID: 8234420
'Hi Barca,

'Place two combo's on your form and paste the following code...

Private Sub Combo1_Click()
    Combo2.Clear
For i = 1 To 31
    If IsDate(CStr(i & "/" & Combo1.ListIndex + 1 & "/" & Year(Now))) Then
        Combo2.AddItem i
    End If
Next
Combo2.ListIndex = 0
End Sub

Private Sub Form_Load()
Combo1.Clear
For i = 1 To 12
    Combo1.AddItem MonthName(i)
Next
Combo1.ListIndex = 0
End Sub
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

580 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