Leo_Polla_Psemata
Registered User.
- Local time
- Today, 03:38
- Joined
- Mar 24, 2014
- Messages
- 364
Hi there
I have two controls in a form that i have locked (enabled yes) .
In some cases, i have to copy paste manual data from one control to another while for other cases this is not needed.
To avoid manual copy paste, i have written the below code in which, i set focus on one control, copy, set focus on the other, unlock, paste, and lock again
However, the last command turns to yellow and doesn't lock the control ?? What's wrong ?
I have two controls in a form that i have locked (enabled yes) .
In some cases, i have to copy paste manual data from one control to another while for other cases this is not needed.
To avoid manual copy paste, i have written the below code in which, i set focus on one control, copy, set focus on the other, unlock, paste, and lock again
However, the last command turns to yellow and doesn't lock the control ?? What's wrong ?
Code:
Private Sub TST2_DblClick(Cancel As Integer)
Me!TST1.SetFocus
DoCmd.RunCommand acCmdCopy
Me!TST2.SetFocus
Me!TST2.Locked = False
DoCmd.RunCommand acCmdPaste
Me!TST2.Locked = True
End Sub