D
DS
I have to run 2 SQL commands, This is what I came up with but I'm sure
there is a cleaner way. It works but cleaner would be better!
Thanks
DS
Private Sub Command4_Click()
CurrentDb.Execute "INSERT INTO JobsDept(DeptID,JobID) VALUES(" &
Forms!DeepJob!DepartmentID & ", " & Me.List0.Column(0) & ")"
Dim MySQL As String
DoCmd.SetWarnings False
MySQL = "UPDATE JobNames SET [Assigned] = True " & _
"WHERE [JobNameID] = Forms!JobPicker![Text6]; "
DoCmd.RunSQL (MySQL)
DoCmd.SetWarnings True
DoCmd.Close acForm, "JobPicker"
Forms!DeepJob.List44.Requery
End Sub
there is a cleaner way. It works but cleaner would be better!
Thanks
DS
Private Sub Command4_Click()
CurrentDb.Execute "INSERT INTO JobsDept(DeptID,JobID) VALUES(" &
Forms!DeepJob!DepartmentID & ", " & Me.List0.Column(0) & ")"
Dim MySQL As String
DoCmd.SetWarnings False
MySQL = "UPDATE JobNames SET [Assigned] = True " & _
"WHERE [JobNameID] = Forms!JobPicker![Text6]; "
DoCmd.RunSQL (MySQL)
DoCmd.SetWarnings True
DoCmd.Close acForm, "JobPicker"
Forms!DeepJob.List44.Requery
End Sub