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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a move cursor to 3

Status
Not open for further replies.
Jul 7, 1999
101
US
Dim Date1 <br>
Dim Date2<br>
<br>
'other setup stuff<br>
<br>
If Date1 &lt; 01/01/1900 then<br>
Date1 = &quot;&quot; ' erase date1<br>
end if ' ok here <br>
[cursor goes to date2]<br>
(need a move cursor to start of date1)
 
Try...<br>
date1.SetFocus<br>
SendKeys &quot;{HOME}&quot;<br>
<br>
That will place the cursor at the beginning of the date1 Text Box. (But NOT the date1 variable)<br>
<br>

 
Alt255 thanks your code works great! There is a problem with the dates (read, program design) in that they are built as maskedit_change and for each number in the date the program must exit and restart. Some other internal pointer moves to date2 if the entire date is entered.<br>
how do I tweek that one. OR would CALL work. Thanks again
 
I'm not familiar with maskedit and I'm not sure what you mean about the CALL. Sorry. If you can access the change event you should be able to include your own validation rules. Can you offer some more information?
 
It seems Maskedit is not high on the list of everybodys favorite function. When I build a maskedit it all ways shows as Maskedit_Change (rather than a _Click that would allow the entry of a full date then start the edits) and <br>
change causes a run thru of the entire function with EACH character entry and the checking for which passthru verses <br>
when to start the edit check and other fun things. IF ANYONE KNOWS HOW TO GET A MASKEDIT_CLICK<br>
PLEASE REPLY THANKS
 
We get a lot of queries about MaskEdit - seems that no-one likes it.<br>
<br>
Another programmer who works for Cargill told me to try the DatePicker control. I haven't used this yet but the applications he writes seem ok.<br>
<br>
Regards<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= > </a><br>
 
Mike ,I found this in some veryold code <br>
Private Sub Amount_Change()<br>
Dim strvalid As String<br>
strvalid = &quot;0123456789.&quot;<br>
If keyascii &gt; 26 Then<br>
If InStr(strvalid, Chr(keyascii)) = 0 Then<br>
keyascii = 0<br>
End If<br>
End If<br>
AccessKeys = vbKeyReturn<br>
End Sub<br>
<br>
Strangely, it works T.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top