hatashibl > 13-04-14, 04:47 PM
MTNQ > 14-04-14, 02:13 AM
Private Sub cmdCopy_Click()
Me!txtTen.SetFocus
DoCmd.RunCommand acCmdCopy
End Sub
Private Sub cmdCopy_Click()
Me!txtID.SetFocus
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
End Sub
MTNQ > 14-04-14, 01:43 PM
Private Sub cmdCopy_Click()
Screen.PreviousControl.SetFocus
DoCmd.RunCommand acCmdCopy
End Sub
Private Sub cmdCopyRecord_Click()
On Error GoTo Err_cmdCopyRecord_Click
Dim rs As DAO.Recordset
Dim strSQL As String
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
Set rs = CurrentDb.OpenRecordset("SELECT * FROM Table1 WHERE ID =" & Me!txtID)
If rs.RecordCount > 0 Then
For i = 0 To rs.Fields.Count - 1
strSQL = strSQL & " " & Trim(rs(i))
Next i
Me!txtCopy.SetFocus
Me!txtCopy = strSQL
DoCmd.RunCommand acCmdCopy
Me!Label35.Visible = True
Else
MsgBox "Chua co du lieu de Copy"
End If
Set rs = Nothing
Exit_cmdCopyRecord_Click:
Exit Sub
Err_cmdCopyRecord_Click:
Set rs = Nothing
MsgBox Err.Description
Resume Exit_cmdCopyRecord_Click
End Sub