Specifying default value for combo box

  • Thread starter Thread starter red6000
  • Start date Start date
R

red6000

Hi,

I have a comobox with a list of dates.

What I would like is when the user clickc the drop down button. it auto goes
to 'today'.

Now I know I could put =date() in the default value, but by default I want
the actual value of the combo box to remain empty.

Is there therefore a VBA way that 'On Click' it highlights 'today' in the
list?

Thanks.
 
red6000 said:
Hi,

I have a comobox with a list of dates.

What I would like is when the user clickc the drop down button. it
auto goes to 'today'.

Now I know I could put =date() in the default value, but by default I
want the actual value of the combo box to remain empty.

Is there therefore a VBA way that 'On Click' it highlights 'today' in
the list?

Perhaps it would be easier to modify the RowSource of the ComboBox so that
today's date is always the first choice at the top of the list.
 
Thanks Rick, do you just mean put =date() in the row course property? If so
I'll then lose my drop down list won't i with all the other dates?

Thanks.
 
red6000 said:
Thanks Rick, do you just mean put =date() in the row course property?
If so I'll then lose my drop down list won't i with all the other
dates?

No I mean modify the query being used for the RowSource so that today's date is
always listed first. You just need to sort first on a calculated field.

SortVal: IIf([DateField] = Date(), 0, 1)
 

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

Similar Threads


Back
Top