Good Question concerning a listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a List box that contains dates of transactions. for example the view
of the listbox as follows.

Jan 1
jan 5
Jan 7

I use this listbox to cascade my appointments to another listbox so its
unbound. If today was jan 2 could I have the listbox automatically select
Jan 5 when I open the form. I probebly guessing I would have to set the
focus to the control box on the form open event. However, what would the code
be to automatically highlight is what I would like but I would also like to
know for future reference also to select the next available date. In this
example it would be Jan 5. Thanks.
 
Hi Brian

You "could" set the focus to wherever you want OnLoad. But in this case is
it isn't really necessary.

You could use =DateAdd("d", 3, [ListBox1]) as the record source of your
cascaded listbox2

This isn't really a good idea as it would always give you three day in
advance - a better idea would be to use a perameter to filter your data - use
a popup form that asked for the number of days.

You don't need code to "highlight" the listbox - just use the condidtional
formating (field got focus) to "highlight" the field.

Hope this helps
 
As I was reading your reply this just joggled my memory. Could I use ,

<Date()



Wayne-I-M said:
Hi Brian

You "could" set the focus to wherever you want OnLoad. But in this case is
it isn't really necessary.

You could use =DateAdd("d", 3, [ListBox1]) as the record source of your
cascaded listbox2

This isn't really a good idea as it would always give you three day in
advance - a better idea would be to use a perameter to filter your data - use
a popup form that asked for the number of days.

You don't need code to "highlight" the listbox - just use the condidtional
formating (field got focus) to "highlight" the field.

Hope this helps

--
Wayne
Manchester, England.
Enjoy whatever it is you do


BrianPaul said:
I have a List box that contains dates of transactions. for example the view
of the listbox as follows.

Jan 1
jan 5
Jan 7

I use this listbox to cascade my appointments to another listbox so its
unbound. If today was jan 2 could I have the listbox automatically select
Jan 5 when I open the form. I probebly guessing I would have to set the
focus to the control box on the form open event. However, what would the code
be to automatically highlight is what I would like but I would also like to
know for future reference also to select the next available date. In this
example it would be Jan 5. Thanks.
 
Back
Top