Hello,
I have the following command button but what I would like to do is that when my 2 tables get transfered to the other db, I don't want to creat a table everytime, I want to append the new records to an existing table? But I have no idea how to do this....
Here is my code and it works fine but it crate a table all the time, I only want to add the records to the other table, and not delete the ones that exist.......
Private Sub CmdTransfer_Click()
DoCmd.TransferDatabase acExport, "Microsoft Access", _
"L:\HoraSec\Data\DispatchBackUp.mdb", acTable, "AgentTrackingModification_tb", _
"Agent_tb " & Date
DoCmd.TransferDatabase acExport, "Microsoft Access", _
"L:\HoraSec\Data\DispatchBackUp.mdb", acTable, "DataTracking_tb", _
"Data_tb " & Date
DoCmd.SetWarnings False
'Qry that deletes the AgentTrackingModification_tb
DoCmd.OpenQuery ("qryDELETEAgentForTracking")
DoCmd.SetWarnings True
DoCmd.SetWarnings False
'Qry that deletes the DataTracking_tb
DoCmd.OpenQuery ("qryDELETEDataForTracking")
DoCmd.SetWarnings True
End Sub
Also I was wondeirng if I can set a timer to my main db, so evernight when the time hits 11:59, the code runs.........
I have the following command button but what I would like to do is that when my 2 tables get transfered to the other db, I don't want to creat a table everytime, I want to append the new records to an existing table? But I have no idea how to do this....
Here is my code and it works fine but it crate a table all the time, I only want to add the records to the other table, and not delete the ones that exist.......
Private Sub CmdTransfer_Click()
DoCmd.TransferDatabase acExport, "Microsoft Access", _
"L:\HoraSec\Data\DispatchBackUp.mdb", acTable, "AgentTrackingModification_tb", _
"Agent_tb " & Date
DoCmd.TransferDatabase acExport, "Microsoft Access", _
"L:\HoraSec\Data\DispatchBackUp.mdb", acTable, "DataTracking_tb", _
"Data_tb " & Date
DoCmd.SetWarnings False
'Qry that deletes the AgentTrackingModification_tb
DoCmd.OpenQuery ("qryDELETEAgentForTracking")
DoCmd.SetWarnings True
DoCmd.SetWarnings False
'Qry that deletes the DataTracking_tb
DoCmd.OpenQuery ("qryDELETEDataForTracking")
DoCmd.SetWarnings True
End Sub
Also I was wondeirng if I can set a timer to my main db, so evernight when the time hits 11:59, the code runs.........