Combo Box...Default Value

  • Thread starter Thread starter Lynn Pennington
  • Start date Start date
L

Lynn Pennington

How can I make the default Value the last in the box.

For example - I have a combo box that pulls the current
weeks that I have in my table.

1, 2, 3, 4, 5, ... 22 --> this is from a Query in the Row
Source property.

We are on the 22 week (fiscal yr). Most likely they will
been running the report on the most current information.

How do I make the default value "22"?

Thanks,
Lynn.
 
Lynn said:
How can I make the default Value the last in the box.

For example - I have a combo box that pulls the current
weeks that I have in my table.

1, 2, 3, 4, 5, ... 22 --> this is from a Query in the Row
Source property.

We are on the 22 week (fiscal yr). Most likely they will
been running the report on the most current information.

If you only wanted to be 22, then just set the combo box's
default value to 22. But, I think you want to set the
default value to the current week. Since I have no idea how
you determine the number of the current week, I'll guess
that you want the week number to be the value in the last
record in the combo box's row source query. If so, then use
some code in the form's Load event:

Private Sub Form_Load()
Combo0.DefaultValue = """" & _
Combo0.ItemData(Combo0.ListCount - 1) & """"
End Sub
 
Did you try going into the query to sort descending by
date? If your combo box is based on the query, the date
should flip to the last item by date vs the first.
 
Thanks.
-----Original Message-----
Did you try going into the query to sort descending by
date? If your combo box is based on the query, the date
should flip to the last item by date vs the first.


.
 
Back
Top