Hi all,
I have a form consisting of textboxes and I open it in datasheet view.
I want to be able to ctrl+v something if I am selecting only one control(one textbox).
But if several texboxes are selected , or the whole record ...then I want to pop up a user-friendly message and disable pasting.
I am thinking of something like
Dim Pasted As Boolean
Dim ctrl As Control
Private Sub Form_BeforeInsert(Cancel As Integer)
If (ctrl.ItemsSelected.Count > 1) Then [highlight #3465A4]<--- this seems to be wrong /missing[/highlight]
Cancel = Pasted
If (Cancel = True) Then
MsgBox "Please paste one field at a time"
End If
End If
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Pasted = KeyCode = vbKeyV And Shift = acCtrlMask
End Sub
I have a form consisting of textboxes and I open it in datasheet view.
I want to be able to ctrl+v something if I am selecting only one control(one textbox).
But if several texboxes are selected , or the whole record ...then I want to pop up a user-friendly message and disable pasting.
I am thinking of something like
Dim Pasted As Boolean
Dim ctrl As Control
Private Sub Form_BeforeInsert(Cancel As Integer)
If (ctrl.ItemsSelected.Count > 1) Then [highlight #3465A4]<--- this seems to be wrong /missing[/highlight]
Cancel = Pasted
If (Cancel = True) Then
MsgBox "Please paste one field at a time"
End If
End If
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Pasted = KeyCode = vbKeyV And Shift = acCtrlMask
End Sub