I am building an issue log database. I have a combo box on a form that lists names of people that could be an OWNER for a particular issue. When someone is chosen from the combobox (i.e. when they trigger the CHANGE event), I need to insert a record into a table called Person_Issue_Involvement that isn't directly related to the form. This is what I've been doing, but I don't seem to be all the way there. Any suggestions? Can this even be done?
Private Sub cboOwner_Change()
Dim strOwnerID As String
Dim dbs As Database
Dim qdf As QueryDef
strOwnerID = Me![cboOwner].Column(1)
mdteSystemDt = Now()
Set dbs = CurrentDb
mstrSQL = "INSERT INTO [Person Issue Involvement] " & _
"(PERSON_ID, " & _
" ISSUE_ID, " & _
" ISSUE_ROLE_CD, " & _
" START_DT) " & _
"VALUES " & _
"('" & strOwnerID & "', " & _
"'" & Forms!frmInput!txtIssueID & "', " & _
"'Ownr', " & _
"'" & mdteSystemDt & "') "
Set qdf = dbs.CreateQueryDef("AddOwner", mstrSQL)
End Sub
Private Sub cboOwner_Change()
Dim strOwnerID As String
Dim dbs As Database
Dim qdf As QueryDef
strOwnerID = Me![cboOwner].Column(1)
mdteSystemDt = Now()
Set dbs = CurrentDb
mstrSQL = "INSERT INTO [Person Issue Involvement] " & _
"(PERSON_ID, " & _
" ISSUE_ID, " & _
" ISSUE_ROLE_CD, " & _
" START_DT) " & _
"VALUES " & _
"('" & strOwnerID & "', " & _
"'" & Forms!frmInput!txtIssueID & "', " & _
"'Ownr', " & _
"'" & mdteSystemDt & "') "
Set qdf = dbs.CreateQueryDef("AddOwner", mstrSQL)
End Sub