dynamic value list???

  • Thread starter Thread starter David
  • Start date Start date
D

David

Can I make a dynamic value list that has this as values?

date()+1;date()+2;date()+3;date()+4;date()+5;date()+6;

I just want the combo box to display the next 6 dates.
 
Not like that, but in your form's Load event, you can create the string and
set the RowSource of the combo box:

Private Sub Form_Load()

Dim strSource As String

strSource = Date() + 1 & ";" & Date() + 2 & ";" & _
Date() + 3 & ";" & Date() + 4 & ";" & _
Date() + 5 & ";" & Date() + 6

Me.MyComboBox.RowSourceType = "Value List"
Me.MyComboBox.RowSource = strSource

End Sub
 
Got it! Simple enough. Thanks!

Douglas J. Steele said:
Not like that, but in your form's Load event, you can create the string
and set the RowSource of the combo box:

Private Sub Form_Load()

Dim strSource As String

strSource = Date() + 1 & ";" & Date() + 2 & ";" & _
Date() + 3 & ";" & Date() + 4 & ";" & _
Date() + 5 & ";" & Date() + 6

Me.MyComboBox.RowSourceType = "Value List"
Me.MyComboBox.RowSource = strSource

End Sub
 
Worked like a charm! Thanks Doug!


Douglas J. Steele said:
Not like that, but in your form's Load event, you can create the string
and set the RowSource of the combo box:

Private Sub Form_Load()

Dim strSource As String

strSource = Date() + 1 & ";" & Date() + 2 & ";" & _
Date() + 3 & ";" & Date() + 4 & ";" & _
Date() + 5 & ";" & Date() + 6

Me.MyComboBox.RowSourceType = "Value List"
Me.MyComboBox.RowSource = strSource

End Sub
 

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