Mouse click in field

  • Follow


Is there a way to locate the cursor at the beginning of a field automatically 
when you click in a field.  Right now, the cursor jumps into the middle of 
the field and my users do not like that.

I know you can do this if you tab into the field, but my users use the mouse 
to move more often.

0
Reply Utf 12/18/2007 4:28:01 PM

Flick,
    Using the control's OnClick event of example LastName
        LastName.SelStart = 0
will place the cursor before the first character.

    But... you probably meant to have the LastName "fully selected"... and 
ready for over-typing, when clicking in.
        LastName.SelStart = 0
        LastName.SelLength = Len(LastName)
-- 
    hth
    Al Campagna
    Microsoft Access MVP
    http://home.comcast.net/~cccsolutions/index.html

    "Find a job that you love... and you'll never work a day in your life."

"Flick Olmsford" <FlickOlmsford@discussions.microsoft.com> wrote in message 
news:15DC0FF3-46F4-4E41-97C7-F9D6CB55D0D4@microsoft.com...
> Is there a way to locate the cursor at the beginning of a field 
> automatically
> when you click in a field.  Right now, the cursor jumps into the middle of
> the field and my users do not like that.
>
> I know you can do this if you tab into the field, but my users use the 
> mouse
> to move more often.
> 


0
Reply Al 12/18/2007 6:15:11 PM


Flick,
    Change my previous code suggested to...
        Date1.SelStart = 0
        Date1.SelLength = Len(Nz(Date1))
    This prevents "Invalid use of null" when clicking into an empty LastName 
control.

-- 
    hth
    Al Campagna
    Microsoft Access MVP
    http://home.comcast.net/~cccsolutions/index.html

    "Find a job that you love... and you'll never work a day in your life."


"Flick Olmsford" <FlickOlmsford@discussions.microsoft.com> wrote in message 
news:15DC0FF3-46F4-4E41-97C7-F9D6CB55D0D4@microsoft.com...
> Is there a way to locate the cursor at the beginning of a field 
> automatically
> when you click in a field.  Right now, the cursor jumps into the middle of
> the field and my users do not like that.
>
> I know you can do this if you tab into the field, but my users use the 
> mouse
> to move more often.
> 


0
Reply Al 12/18/2007 6:20:35 PM

Thanks.  I was kind of hoping for one setting though for the entire form but 
this will do.   I can probably create some code that sets this on the form 
opening.  



"Al Campagna" wrote:

> Flick,
>     Change my previous code suggested to...
>         Date1.SelStart = 0
>         Date1.SelLength = Len(Nz(Date1))
>     This prevents "Invalid use of null" when clicking into an empty LastName 
> control.
> 
> -- 
>     hth
>     Al Campagna
>     Microsoft Access MVP
>     http://home.comcast.net/~cccsolutions/index.html
> 
>     "Find a job that you love... and you'll never work a day in your life."
> 
> 
> "Flick Olmsford" <FlickOlmsford@discussions.microsoft.com> wrote in message 
> news:15DC0FF3-46F4-4E41-97C7-F9D6CB55D0D4@microsoft.com...
> > Is there a way to locate the cursor at the beginning of a field 
> > automatically
> > when you click in a field.  Right now, the cursor jumps into the middle of
> > the field and my users do not like that.
> >
> > I know you can do this if you tab into the field, but my users use the 
> > mouse
> > to move more often.
> > 
> 
> 
> 
0
Reply Utf 12/18/2007 9:51:05 PM

Flick,
   Actually there is a built in method in Access to do just that.
   If the Text Control has an associated label, the user can
click the label, and the fields contents will be highlited...
just as if you tabbed into it.
Click the label
    |
   V
LastName: ___________
-- 
    hth
    Al Campagna
    Microsoft Access MVP
    http://home.comcast.net/~cccsolutions/index.html

    "Find a job that you love... and you'll never work a day in your life."


"Flick Olmsford" <FlickOlmsford@discussions.microsoft.com> wrote in message 
news:D06E29A7-C301-49D9-9944-012ECA88C8E0@microsoft.com...
> Thanks.  I was kind of hoping for one setting though for the entire form 
> but
> this will do.   I can probably create some code that sets this on the form
> opening.
>
>
>
> "Al Campagna" wrote:
>
>> Flick,
>>     Change my previous code suggested to...
>>         Date1.SelStart = 0
>>         Date1.SelLength = Len(Nz(Date1))
>>     This prevents "Invalid use of null" when clicking into an empty 
>> LastName
>> control.
>>
>> -- 
>>     hth
>>     Al Campagna
>>     Microsoft Access MVP
>>     http://home.comcast.net/~cccsolutions/index.html
>>
>>     "Find a job that you love... and you'll never work a day in your 
>> life."
>>
>>
>> "Flick Olmsford" <FlickOlmsford@discussions.microsoft.com> wrote in 
>> message
>> news:15DC0FF3-46F4-4E41-97C7-F9D6CB55D0D4@microsoft.com...
>> > Is there a way to locate the cursor at the beginning of a field
>> > automatically
>> > when you click in a field.  Right now, the cursor jumps into the middle 
>> > of
>> > the field and my users do not like that.
>> >
>> > I know you can do this if you tab into the field, but my users use the
>> > mouse
>> > to move more often.
>> >
>>
>>
>> 


0
Reply Al 12/18/2007 10:54:32 PM

This is really going to have to be done a control by control basis, I'm
afraid, rather than setting all controls when the form loads. 

Just as a side note, doing the

LastName.SelStart = 0

thing in the control's OnClick event is an absolute  ***must***  when using
Input Masks! Otherwise, users like yours will click on the control somewhere
other than the beginning of the field, start typing, and get really upset
when they get an error because the entered data didn't meet the mask's
requirement! They then have to go back and re-enter it.

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

0
Reply Linq 12/19/2007 12:32:09 AM

Thanks to all of you.  You have been a great help.



"Linq Adams via AccessMonster.com" wrote:

> This is really going to have to be done a control by control basis, I'm
> afraid, rather than setting all controls when the form loads. 
> 
> Just as a side note, doing the
> 
> LastName.SelStart = 0
> 
> thing in the control's OnClick event is an absolute  ***must***  when using
> Input Masks! Otherwise, users like yours will click on the control somewhere
> other than the beginning of the field, start typing, and get really upset
> when they get an error because the entered data didn't meet the mask's
> requirement! They then have to go back and re-enter it.
> 
> -- 
> There's ALWAYS more than one way to skin a cat!
> 
> Answers/posts based on Access 2000/2003
> 
> Message posted via http://www.accessmonster.com
> 
> 
0
Reply Utf 12/19/2007 3:12:01 PM

6 Replies
106 Views

(page loaded in 0.524 seconds)

Similiar Articles:
















7/23/2012 3:08:25 AM


Reply: