Re: Place cursor in a control and have exisiting text highlighted,
- From: "Karen" <kskipper@xxxxxxxxxxx>
- Date: 25 Sep 2006 07:58:40 -0700
Barry Gilbert wrote:
If you just use SetFocus (the first line of my suggestion), it should put theI got it working with the following in the code
cursor there and highlight the text. If it doesn't do this, go to Tools,
Options, Keyboard tab. If you set the "Behavior After Entering Field" value
to "Select Entire Field", it should select the entire value.
Barry
"Karen" wrote:
Barry Gilbert wrote:
Instead of navigating records, try something like this:Well...
Me.txtEnterCode.SetFocus
Me.txtEnterCode=""
Barry
"Karen" wrote:
That's a long subject line, isn't it...
Anyway, I have a form (continuous records) that uses an unbound control
(entercode) with a AfterUpdate event to trigger a query. So the user
enters an item number in entercode and when the Enter key is pressed
the code gets done. The code is Me.Requery and entercode.setfocus.
The form displays the code and description in the header and then the
location, picksequence, qty on hand etc in the detail section. There
may be multiple locations for a code.
I want to have the cursor return to the entercode control and have the
text there be highlighted and ready to be replaced when the user starts
typing another code. I was able to do this by using the Navigation
Buttons to go to last record and then go to first record. So I tried
doing this in the code using
docmd.gotorecord acdataform, "frm Item View", aclast
that works great unless the code entered has the same number of
locations as the previous code. when that happens the cursor returns
to the entercode control but the text isn't highlighted and the user
has to delete the old code before entering a new code.
Any ideas of how I can make this work?
Thanks in advance,
Karen
that's okay except the users won't see the code they entered while they
look at the details of the code.
Next idea?
K-
me.requery
docmd.gotorecord ....
entercode.setfocus
and then in the Tools, options, keyboard; Move after enter = Don't Move
and Behavior After Entering Field = Select Entire Field.
I needed the gotorecord so that I could get an 'Item Not found' message
to appear when necessary.
Thanks for your help.
K-
.
- References:
- Prev by Date: Dilemma for Key Field
- Next by Date: Re: Change Hour + Decimal to Hour + Min
- Previous by thread: Re: Place cursor in a control and have exisiting text highlighted,
- Next by thread: Re: Counting how many times a button is pressed
- Index(es):