sweeneytime
New member
- Local time
- Tomorrow, 03:06
- Joined
- Oct 9, 2012
- Messages
- 9
Hi guys,
On my form I have a button which I want to do the following:
Status field: Change to "Inactive"
Copy record
Paste record
Goto last record
Status field: Change to "Active"
I have the copy part done, it then moves to the last record which is the new one. But the code I have to insert value does nothing, it's what I have gotten from goggle. I have tried it as table name "dbo_Employee_Data" and "Employee_Data"
If some knows where I am going wrong it would be much appreciated!
Cheers,
Sweeneytime
On my form I have a button which I want to do the following:
Status field: Change to "Inactive"
Copy record
Paste record
Goto last record
Status field: Change to "Active"
I have the copy part done, it then moves to the last record which is the new one. But the code I have to insert value does nothing, it's what I have gotten from goggle. I have tried it as table name "dbo_Employee_Data" and "Employee_Data"
If some knows where I am going wrong it would be much appreciated!
Cheers,
Sweeneytime
Code:
Private Sub Command70_Click()
Dim strStatusActive As String
Dim strStatusInActive As String
strStatusActive = "Active"
strStatusInActive = "InActive"
SQL = "INSERT INTO dbo_Employee_Data (Status) VALUES ('" & strStatusActive & "')"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend
DoCmd.RunCommand acCmdRecordsGoToLast
SQL = "INSERT INTO dbo_Employee_Data (Status) VALUES ('" & strStatusInActive & "')"
End Sub