[AccessD] Sel Start and Sel Length not working for me

Bob Gajewski rbgajewski at adelphia.net
Sat Apr 4 09:26:52 CDT 2009


Hi Rocky

This works for me, and then I just call the function in the OnClick events
...


Function cbfClick()
    Me.ActiveControl.SelStart = 0
    Me.ActiveControl.SelLength = Nz(Len(Me.ActiveControl), 0)
End Function


Best regards,
Bob Gajewski
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 02, 2009 19:35 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Sel Start and Sel Length not working for me

I set the options to select the entire field but it didn't seem to hold.
The field wasn't selected when I tabbed into it  and when I looked at the
option it was set back to start of field.

What I needed was:

Application.SetOption "Behavior Entering Field", 0

In the open event of the form where I wanted that behavior. It does not
carry over from one form to the next.

HTH

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 02, 2009 2:50 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Sel Start and Sel Length not working for me

I'll need an OnClick cal to select the text.  But the database options to
select entire field seems to work for the tabbing.

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
Sent: Thursday, April 02, 2009 2:24 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Sel Start and Sel Length not working for me

...and does it still work if  you tab into it ...and does it still work if
you select it in code, ie: me!textname.setfocus

And every other way it can be selected?

Max



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: 02 April 2009 22:18
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Sel Start and Sel Length not working for me

Ah, good one!  When I tab into it I get the field selected.  Click, no go. 

If I put the call into the click event, then walla!, data selected.  

Unfortunately I have 14 of these little text boxes on the form so I'll have
to have both a click and an enter event calling the text selector for each
one.

Problem solved.  

Thanks once again to all for your help. 

Best,

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
Sent: Thursday, April 02, 2009 2:07 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Sel Start and Sel Length not working for me

I bet if you TAB into it, it selects the current value. Allowing you to
overtype.
If you click on it, then it probably won't

Max



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: 02 April 2009 20:03
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Sel Start and Sel Length not working for me

Dear List:

In the got focus event of a bound text box I want to have all the current
text selected.  The box can only have a 0 or 1.It is bound to a field of
data type number

The following code should (I think, but obviously not) select all the text
in the box but doesn't.  Can anyone see why?

 

    Me.fldFHxDetailMotherResponse.SelStart = 0
    Me.fldFHxDetailMotherResponse.SelLength =
len(Me.fldFHxDetailMotherResponse)

I also tried:

    Me.fldFHxDetailMotherResponse.SelStart = 0
    Me.fldFHxDetailMotherResponse.SelLength = 1


just to make things simple.  But no soap.

 
MTIA,
 

Rocky Smolin

Beach Access Software

858-259-4334

www.e-z-mrp.com <http://www.e-z-mrp.com/> 

www.bchacc.com <http://www.bchacc.com/> 

 

 





--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list