Combo Box...Default Value

  • Thread starter Lynn Pennington
  • 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.
 
M

Marshall Barton

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
 
R

Rick

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.
 
L

Lynn Pennington

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.


.
 

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

Top