SelText Not Recognized - Help please

D

default105

I am trying to use the following code in a textbox

if asc(key) = 3 then
me.seltext = chr(13)
return true
end if

I get the following when the code is supposed to be executed, it opens VB
*Compile error: Method or data member not found*

When I highlight, right click and choose definition I receive
*Identifier under cursor is not recognized*

When I highlight, right click and choose Object Browser and search for
SelText it says it is a member of Access with 2 classes, Combo Box and
Textbox.
The location of Access is C:\Program Files\Microsoft
Office\OFFICE11\MSACC.OLB, Microsoft Access 11.0 Object Library

When I checked the References the Microsoft Access 11.0 Object Library is
checked. How do I get it to recognize this identifier in this library.

Thanks.
 
D

Douglas J. Steele

You've forgot to include the name of the textbox. Me refers to the form: you
need something like:

Me.Text1.SelText = Chr(13)

It may also be necessary to ensure that focus is on the textbox:

Me.Text1.SetFocus
 
D

default105

Tried that, but the SelText is not available
All that is available is SelHeight, SelLeft, SelTop, SelWidth

I need to get SelText to be a recognizable member.
 
Top