please help

  • Thread starter Thread starter SJJ via AccessMonster.com
  • Start date Start date
S

SJJ via AccessMonster.com

i wrote vba code to generate dates between given two start and end dates.

how can i put these dates into the rowsource of a combo box.

i tried it and no solution, any body please.

thanks in advance
 
SJJ via AccessMonster.com said:
i wrote vba code to generate dates between given two start and end
dates.

how can i put these dates into the rowsource of a combo box.

i tried it and no solution, any body please.

thanks in advance

You could create a user-defined RowSourceType function. Such a function
can be specified in a combo or list box's RowSourceType property. The
function must take specific arguments and return specific values
depending on which argument values are passed to it. For details, go
into the VB Editor and search the help for "rowsourcetype function".
 
i wrote vba code to generate dates between given two start and end
dates.

how can i put these dates into the rowsource of a combo box.

dim rowSourceString as string rowSourceString = ""

for tempDate = #2005-09-12# to #2006-02-21# step 7
' don't add a semicolon before the first item if
len(rowSourceString)>0 then
rowSourceString = rowSourceString & ";"
end if rowSourceString = rowSourceString & _
Format(tempDate, "dd/mm/yyyy")

next tempDate

myList.RowSourceType = "Value List" myList.RowSource = rowSourceString
myList.Requery


Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top