Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Click event in a text box?

Status
Not open for further replies.

SMCmtg

Programmer
Mar 27, 2000
90
US
What is the command to go to the beginning of a field when txtbox is clicked and the field is empty? Imput mask is ### and format is slect all when you tab to it and it has data, but if I click to the txtbox and its field is empty how can I automatically be to the left?

IF EMPTY(mytable.mynumber)=.T.
???
endif

Appreciate any feedback!

JuanDiego

 
in the gotfocus event of the text box, put the code
IF EMPTY(This.Value)
KEYBOARD {HOME}
ENDIF
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Forgot the quotes, there, Ramani :eek:)

IF EMPTY(This.Value)
KEYBOARD "{HOME}"
ENDIF
 
To be real picky, just in case somewhere HOME has been redefined (with a recorded macro or OKL), it should be:

IF EMPTY(This.Value)
KEYBOARD "{HOME}" PLAIN
ENDIF

Rick


 
To Ramani,Chpicker and Rick:

Thank for your feedback, appreciated!

I discovered I did not need the snipet. . .(I discovered I had the alignment property set to "left" as vs "automatic" . . .the default. . ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top