|
-
Oct 26th, 2006, 12:45 PM
#1
Thread Starter
Junior Member
Access 2000 AddItem
Hi,
I developed a form in Access 2003 which has a combo box in it. The combo box displays all the years since 1900 until the current year. I created a function called PopulateCboYear and called the function when the form is loaded:
Private Sub PopulateCboYear()
Dim iYear As Integer
For iYear = 1900 To Year(Now())
cboYear.AddItem (iYear)
Next
End Sub
The function worked perfectly in Access 2002 and 2003, but not in 2000. I then realized that Access 2000 does not have the AddItem function and, therefore, added a module called AddItem according to some suggestions I found on the internet:
Sub ListAddItem(LB As ListBox, ByVal strItemToAdd As String)
LB.RowSource = IIf(LB.RowSource = "", strItemToAdd, LB.RowSource & ";" & strItemToAdd)
End Sub
I was hoping that by adding this module, the PopulateCboYear function would work, but it doesn't, and I can use some help from smart people like you!!
Thank you,
egghi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|