R
Randy
Hello again....I have a code that when a form is opened it copies data from
one field and pastes into another field. The problem is I need the field the
funtion is copying data into to remain locked. However, if the field is
locked the copy function does not work.
I need this funtion to be able to unlock the field, then copy the data into
the field and lock the field back up again. Any suggestions will of course be
greatly appreciated.
Here is my code so far:
Function LastModified_CopyFuntion()
On Error GoTo LastModified_CopyFuntion_Err
DoCmd.GoToControl "DateModified2"
DoCmd.RunCommand acCmdCopy
DoCmd.GoToControl "History2"
SendKeys "{Right}", True
SendKeys "{Enter}", True
DoCmd.RunCommand acCmdPaste
SendKeys "{Tab}", True
LastModified_CopyFuntion_Exit:
Exit Function
LastModified_CopyFuntion_Err:
MsgBox Error$
Resume LastModified_CopyFuntion_Exit
End Function
one field and pastes into another field. The problem is I need the field the
funtion is copying data into to remain locked. However, if the field is
locked the copy function does not work.
I need this funtion to be able to unlock the field, then copy the data into
the field and lock the field back up again. Any suggestions will of course be
greatly appreciated.
Here is my code so far:
Function LastModified_CopyFuntion()
On Error GoTo LastModified_CopyFuntion_Err
DoCmd.GoToControl "DateModified2"
DoCmd.RunCommand acCmdCopy
DoCmd.GoToControl "History2"
SendKeys "{Right}", True
SendKeys "{Enter}", True
DoCmd.RunCommand acCmdPaste
SendKeys "{Tab}", True
LastModified_CopyFuntion_Exit:
Exit Function
LastModified_CopyFuntion_Err:
MsgBox Error$
Resume LastModified_CopyFuntion_Exit
End Function