List Box Question

G

Gina Whipp

I know I can set this as the Default Value in a Combo Box...
[Form].[CategoryID].[ItemData](0)

Is there anything I can set to force the first item in a list box to be
'selected' On Open?

Thanks in advance...
Gina Whipp
 
G

Gina Whipp

Hi Glenn,

That's not working, thanks anyway.

Gina Whipp


Glenn said:
Me.ListName.Selected(0) = True

-----Original Message-----
I know I can set this as the Default Value in a Combo Box...
[Form].[CategoryID].[ItemData](0)

Is there anything I can set to force the first item in a list box to be
'selected' On Open?

Thanks in advance...
Gina Whipp


.
 
G

Gina Whipp

Ok, I'm slow it works on the On Open Property of the form not on the Default
Value in the Property window.... BIG THANKS!

Glenn said:
Me.ListName.Selected(0) = True

-----Original Message-----
I know I can set this as the Default Value in a Combo Box...
[Form].[CategoryID].[ItemData](0)

Is there anything I can set to force the first item in a list box to be
'selected' On Open?

Thanks in advance...
Gina Whipp


.
 
B

Bruce M. Thompson

I know I can set this as the Default Value in a Combo Box...
[Form].[CategoryID].[ItemData](0)

Is there anything I can set to force the first item in a list box to be
'selected' On Open?

Try something like:

Me.List1.Value = Me.List1.ItemData(Abs(Me.List1.ColumnHeads))

Note that you will need to replace "List1" with the name of your listbox. The
use of the "ColumnHeads" property ensures that the code will work properly
whether the listbox's "ColumnHeads" property is set to "Yes" or "No".
 

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