Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text box to Select the shown text

Status
Not open for further replies.

dusteater

Programmer
Aug 15, 2001
13
US
I have a text box that I want the info in the window to be the data selected. In VB I can use the TopIndex property and Selected properties to achieve this but I can't figure out how to do this in Access. In other words, the list box has the following values: "ON";"Off"; "Waiting". The List box will show "Waiting" on form load. But the user can scroll to the other choices and then save the changes. When the user scrolls to another choice the old choice is still selected but not visible. The user might think that the object that is showing is the data that is going to be used but it is not. Is there a solution to this in VBA??? I hope so!
Thanks in advance
Rick
 
>When the user scrolls to another choice the old choice is still selected but not visible.

If you are going to use a list box, I suggest you change the control height so all choices a visible. This makes it clearer to the user that he has to *select* his choice, not just scroll until his choice is visible.

Once the user makes that selection you can refer to it in code by using the control's column property
control.column(0) (It's zero-based) refers to the bound column of my list box.

I think a combo box may be a better choice if space is an issue. (In design view, right click on the list box and choose "change to" from the menu)

One thing confuses me about your post. You are setting a default value on form *load*. Shouldn't that be set in the ontrol's default value property?

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top