Combo box question

B

Bob Howard

I use A2K3 and have a combo box that I typically enter by tabbing from a
prior text control on the form (the user is using the form to modify
existing data --- the controls are bound).

Normally, the behavior when entering a field is that the cursor simply goes
to the start of the text area. And this is what had been occuring when
entering the combo box until I made a small change ... and the result of
that change is that the entire contents of the text portion of the combo box
are now being selected (highlighted). And I don't want that.

Here's the change...

I implemented an "On Enter" event for the combo box. In that event, I do
some calculations and determine what I want to use as the ListRows property.
When I set that property, the contents of the control get selected. If I
don't set the ListRows property, the contents of the control do not get
selected ... the cursor simply goes to the first position (which is what I
want).

My overall Access options on the Keyboard tab for the "behavior entering
field" option specify ""Go to start of field" ... so that's OK.

It's clear that setting the ListRows property is causing the contents to be
selected.

I also experimented, and found that setting AutoExpand=True also causes this
.... even though AutoExpand is already set to True on the control's property
sheet.

Any way I can get around this??

bob
 
B

Bob Howard

Addendum --- I changed this to use the Got Focus event (rather than the
Enter event) and observe the same behavior. Bob
 
B

Bob Howard

That did it! Thanks so much. I guess it's not worth trying to figure out
why my little change caused the strange behavior --- since your fix now
makes it "work". Bob
 

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