473,385 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Setfocus jumps to next field, but default value is selected in that field.

I use SetFocus to jump from one field to another. That works fine. But
one of the focussed fields has default text and this text is selected
and the cursor is on the left of it. How to have the curosr positioned
at the right of the default (or filled) text?

Bart
(v 2003)

Feb 18 '06 #1
4 3298

"AA Arens" <ba***********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I use SetFocus to jump from one field to another. That works fine. But
one of the focussed fields has default text and this text is selected
and the cursor is on the left of it. How to have the curosr positioned
at the right of the default (or filled) text?

Bart
(v 2003)


First things first, why are you using SetFocus jump from one field to
another? Why don't use set the tab order correctly?

Here's a solution for your question

After the line Me![FieldName].SetFocus
Me![FieldName].SelStart = Len(Me![FieldName])

Jeff
Feb 18 '06 #2
Hi Jeff,

It works. I use SetFocus as most of the field as list boxes and after
selecting the right value it jumps to the next value which it does not
with only TAB or when there is no List Box. I already set the right TAB
order.
Regarding that, when there is no list box, I use to use TAB. How to
have the cursor also jumped to the right?
I guess I need to choose the KeyPress part.

Bart

Feb 18 '06 #3
AA Arens wrote in message
<11********************@g43g2000cwa.googlegroups.c om> :
Hi Jeff,

It works. I use SetFocus as most of the field as list boxes and after
selecting the right value it jumps to the next value which it does not
with only TAB or when there is no List Box. I already set the right TAB
order.
Regarding that, when there is no list box, I use to use TAB. How to
have the cursor also jumped to the right?
I guess I need to choose the KeyPress part.

Bart


The lazy way, could be to enter Tools | Options - in the Keyboard tab,
then akter the "Behavior entering field" property (Go to end of field).

This can be manipulated programatically too, if you like (some typed
not tested sample)

' declaration section
private lngProp as long

' in a sub...
lngProp = application.getoption("behavior entering field")
if lngProp <> 2 then
application.setoption "behavior entering field", 2
end if

' then afterwards (form close/unload?) reset

BTW - if you intend to try to trap through some of the key events, try
the KeyDown. I dont think the KeyPress will catch keys that will cause
the focus to change ...

--
Roy-Vidar
Feb 18 '06 #4

"AA Arens" <ba***********@gmail.com> schreef in bericht news:11**********************@g44g2000cwa.googlegr oups.com...
I use SetFocus to jump from one field to another. That works fine. But
one of the focussed fields has default text and this text is selected
and the cursor is on the left of it. How to have the curosr positioned
at the right of the default (or filled) text?


You will need to look at Selstart in Help

Arno R
Feb 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sarah West | last post by:
Hi, I have the following problem; This is my form, i would like to default the select box to USA, and default the text field to a name such as 'Sarah' and the hidden field to another number...
3
by: Earthling | last post by:
Any help would be appreciated to solve the following simple problem that I will describe. *** There is a form called "red chocolate form". The form has a particular subform field that has a...
4
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1....
1
by: Tony | last post by:
Hi, On a form, when field A is changed, I update field B automatically by Setfocus to field B, and then assign it with another value. This is handled in the field A AfterUpdate method. After...
0
by: srinivasarao yarru | last post by:
hi sir, in access 2003 how we can use the setfocuse property(we have to lostfocuse from one field with in that we have to setfocuse in same field) i am using this code but not setfocuse...
3
by: srinivasarao yarru | last post by:
hi in access 2003 how we can use the setfocuse property(we have to lostfocuse from one field with in that we have to setfocuse in same field) i am using this code but not setfocuse to same field...
2
dlite922
by: dlite922 | last post by:
Before traversing my code, here's what my goal is and what this function does: I have a table of fields that dynamically grows as the user enters information. A minimum of 3 rows must always...
4
by: Michael R | last post by:
Hi everyone. I wanna say first, I appritiate a lot the fact that I'm able to ask questions here! I have a form with a textbox that if its value equals to a certain condition, a command button...
2
by: BobbyDazzler | last post by:
have recently converted an access 97 to access 2000 (via 2003). All working well except my invoicing form. set up as frminvoice with sfminvoicedetail once the sale details are entered in the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.