Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

populate combo box with Month Year

Posted on 2006-11-28
2
Medium Priority
?
799 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

609 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