Assuming you have combo box declared to accept its data as a list (ie RowSourceType = Value List) then something like:
Dim i as Integer
Dim strList as String
strList = ""
For i = 7 to 1 Step -1
If Len(strList) = 0 Then
strList = DateAdd("d",-i,Date())
Else
strList = ";" & strList
strList = strList & DateAdd("d",-i,Date())
End If
Next i
cboDate.RowSource = strList
should do it, you may need to add a format statement around the date, I have not done this becuase I do not know where you are and if you are using Uk style date or US style date
Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now -
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.