RE: How to insert date at caret position in text control.
- From: "ThomasAJ" <ThomasAJ@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 2 Nov 2005 20:32:15 -0800
Sorry, I initially should have said my code made garbage.
OK
sDate = "abc-xyz" makes it repeat endlessly until stack space runs out.
Others are too hard to explain.
--
Regards
Tom
"'69 Camaro" wrote:
> > Same problem with your code as with mine.
>
> Your code made "nothing" happen. My code made garbage. ;-)
>
> For each of the four examples given, what did the garbage string look like?
> And was there an error message?
>
> HTH.
> Gunny
>
> See http://www.QBuilt.com for all your database needs.
> See http://www.Access.QBuilt.com for Microsoft Access tips.
>
> (Please remove ZERO_SPAM from my reply E-mail address so that a message will
> be forwarded to me.)
> - - -
> If my answer has helped you, please sign in and answer yes to the question
> "Did this post answer your question?" at the bottom of the message, which
> adds your question and the answers to the database of answers. Remember that
> questions answered the quickest are often from those who have a history of
> rewarding the contributors who have taken the time to answer questions
> correctly.
>
>
> "ThomasAJ" wrote:
>
> > Same problem with your code as with mine.
> >
> > The problem is that if 'sDate' contains anything other than alpha characters
> > then what is sent is garbage.
> >
> > eg sDate = "123" and I get garbage.
> > sDate = "abc" then works fine
> > sDate = "01/01/2005" then garbage
> > sDate = "abc-xyz" then garbage
> >
> > Any ideas.
> >
> > --
> > Regards
> > Tom
> >
> >
> > "'69 Camaro" wrote:
> >
> > > Hi, Tom.
> > >
> > > Try:
> > >
> > > Private Sub txtSomeValue_KeyDown(KeyCode As Integer, Shift As Integer)
> > >
> > > On Error GoTo ErrHandler
> > >
> > > Dim sDate As String
> > > Dim nAltKey As Integer
> > >
> > > sDate = "10/31/2005"
> > > nAltKey = (Shift And acAltMask) > 0
> > >
> > > If (nAltKey And (Chr(KeyCode) = "d")) Then
> > > SendKeys sDate, False
> > > End If
> > >
> > > Exit Sub
> > >
> > > ErrHandler:
> > >
> > > MsgBox "Error in txtSomeValue_KeyDown( ) in " & _
> > > vbCrLf & Me.Name & " form." & vbCrLf & vbCrLf & _
> > > "Error #" & Err.Number & vbCrLf & Err.Description
> > > Err.Clear
> > >
> > > End Sub
> > >
> > > . . . where txtSomeValue is the name of the text box needing the date
> > > inserted at the caret whenever <ALT><D> is pressed on the keyboard.
> > >
> > > HTH.
> > > Gunny
> > >
> > > See http://www.QBuilt.com for all your database needs.
> > > See http://www.Access.QBuilt.com for Microsoft Access tips.
> > >
> > > (Please remove ZERO_SPAM from my reply E-mail address so that a message will
> > > be forwarded to me.)
> > > - - -
> > > If my answer has helped you, please sign in and answer yes to the question
> > > "Did this post answer your question?" at the bottom of the message, which
> > > adds your question and the answers to the database of answers. Remember that
> > > questions answered the quickest are often from those who have a history of
> > > rewarding the contributors who have taken the time to answer questions
> > > correctly.
> > >
> > >
> > > "ThomasAJ" wrote:
> > >
> > > > In the Form's KeyDown event I test for say 'Alt D' thus:
> > > >
> > > > blnAlt = (Shift And acAltMask)
> > > >
> > > > then if TRUE I perform
> > > >
> > > > If KeyCode = vbKeyD Then SendKeys strDate, True
> > > >
> > > > where strDate contains a date.
> > > >
> > > > However nothing happens. What am I missing?
> > > >
> > > > --
> > > > Regards
> > > > Tom
.
- Follow-Ups:
- RE: How to insert date at caret position in text control.
- From: '69 Camaro
- RE: How to insert date at caret position in text control.
- References:
- RE: How to insert date at caret position in text control.
- From: '69 Camaro
- RE: How to insert date at caret position in text control.
- From: ThomasAJ
- RE: How to insert date at caret position in text control.
- From: '69 Camaro
- RE: How to insert date at caret position in text control.
- Prev by Date: Re: Exclamation or Dot
- Next by Date: Re: How do I update an MSAccess table without opening MSAccess?
- Previous by thread: RE: How to insert date at caret position in text control.
- Next by thread: RE: How to insert date at caret position in text control.
- Index(es):
Relevant Pages
|