?
Solved

populate combo box with Month Year

Posted on 2006-11-28
2
Medium Priority
?
793 Views
Last Modified: 2008-01-09
hi,
May form_load event
Basically how can i populate combo box with values January 2006 to December 2006.
0
Comment
Question by:sikan71
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 800 total points
ID: 18032938
place this codes in the form's module

Function FillDate() As String
Dim dDate, j, tDate
dDate = 1  & "/" & 1 & "/" & Year(Date)
For j = 0 To 11
    tDate = tDate & ";" & Format(DateAdd("m", j, dDate), "mmmm yyyy")

Next
    FillDate = Mid(tDate, 2)
End Function

in the load event of the form

private sub form_load()

me.comboName.RowSourceType = "Value list"
me.comboName.RowSource = FillDate()

end sub
0
 

Author Comment

by:sikan71
ID: 18033202
Now, how do i insert this selected value into the table.
tablename: tblMethadone
fieldname: Month

I have ten different facility listed in the table.  On the form I have combo box for facility.  If combo box for facility equal table facility then i want to insert this selected item of cmbMonth into the table.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

762 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