Mark A Matte
markamatte at hotmail.com
Fri Sep 29 10:46:09 CDT 2006
Sounds to me like the row source has mor than 1 column(ID,Description). When you use LEN of that field...it is using the length of your bound column. I tried the following but it only worked when I used a breakpoint and stepped thru the code. Not sure why...but does show why your LEN is giving you the wrong results...also I used the code ONENTER not click. Hope it helps, Mark A. Matte Combo4.SetFocus Dim test test = Len(Combo4.Text) Combo4.SelLength = test >From: "Gustav Brock" <Gustav at cactus.dk> >Reply-To: Access Developers discussion and problem >solving<accessd at databaseadvisors.com> >To: <accessd at databaseadvisors.com> >Subject: Re: [AccessD] Select All Text in DropDown >Date: Fri, 29 Sep 2006 15:20:08 +0200 > >Hi Virginia > >When tabbing into the combo, all the text should be selected. If clicking, >it should not, but the cursor should be positioned at the click point - if >the cursor moves to first position, it sounds like you have some update or >refresh code running at the OnClick event. > >/gustav > > >>> hollisvj at pgdp.usec.com 29-09-2006 14:57:24 >>> >No, wish it was that easy..... that is already selected. When they click >or enter the combo box, it does not select the existing text. Shouldn't >the SelLength or one of the Sel do it? But it isn't.... > > > >Virginia > >________________________________ > > >...tools/options/keyboard/select entire field? > >William Hindman > >________________________________ > > >From: Hollis, Virginia >Sent: Thursday, September 28, 2006 2:13 PM >To: 'accessD at databaseadvisors.com' >Subject: Select All Text in DropDown > > > >I have a form with a combo box that brings up the data for the selected >name in the dropdown. When the user enters, clicks, or has the focus of >the combo I need it to select all the text in the field. For some reason >it always goes to the beginning of the field so they can't just start >typing a name to find it, they always have to scroll the list or >highlight the text in the box first, then delete it or start typing >after it is highlighted. They want the text in the combo from the >current record to already be highlighted so they can easily find another >record by typing the person's name without any extra steps. > > > >I tried this, but it only highlights the first 3 characters of the name >instead of the whole name. How does it determine the length of the field >and select all of it? > > > >Private Sub FindName_GotFocus() > > FindName.SetFocus > FindName.SelLength = Len(FindName) > >End Sub > > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com