Solved

populate combo box with Month Year

Posted on 2006-11-28
2
768 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
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 200 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

770 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