gregoryagu
Registered User.
- Local time
- Today, 04:46
- Joined
- May 7, 2009
- Messages
- 29
I have a screen that has one large textbox on it. The user goes to this textbox and adds information to the bottom. The text can get very long, several thousand characters or more. (I know it's poorly designed, but I can't change that at the moment.)
I would like to add some code so that the user can press Ctrl + D to add the current date the the bottom of the textbox (or at the cursor would be OK too). To do this, I added the following code:
Private Sub HISTORY_SCREEN_KeyUp(KeyCode As Integer, Shift As Integer)
If Me.ActiveControl = Me.HISTORY_SCREEN Then
If Shift = 2 And KeyCode = 68 Then
Me.HISTORY_SCREEN.text = Me.HISTORY_SCREEN.text + "Insert Date Here"
Me.HISTORY_SCREEN.SelStart = Len(Me.HISTORY_SCREEN.text)
End If
End If
End Sub
However, there are two issue. First, I don't know the code to return the current date in a string format. Second, the code fails because the text is too long to fit in a string variable and so fails.
Any help would be appreciated.
Greg
I would like to add some code so that the user can press Ctrl + D to add the current date the the bottom of the textbox (or at the cursor would be OK too). To do this, I added the following code:
Private Sub HISTORY_SCREEN_KeyUp(KeyCode As Integer, Shift As Integer)
If Me.ActiveControl = Me.HISTORY_SCREEN Then
If Shift = 2 And KeyCode = 68 Then
Me.HISTORY_SCREEN.text = Me.HISTORY_SCREEN.text + "Insert Date Here"
Me.HISTORY_SCREEN.SelStart = Len(Me.HISTORY_SCREEN.text)
End If
End If
End Sub
However, there are two issue. First, I don't know the code to return the current date in a string format. Second, the code fails because the text is too long to fit in a string variable and so fails.
Any help would be appreciated.
Greg