captainlove
captainlove
- Local time
- Today, 16:27
- Joined
- Apr 18, 2008
- Messages
- 39
I have a mainform with a combo box to select quality control procedures i.e 10000 when I do select with the combo box the subform is populated with references and responsibilites.
I have a text box to insert new references . I am trying to create a command button to delete references I want from the subform, but cannot seem to get it to work. Here is the code I have
working
Dim sql As String
sql = "INSERT INTO tblreferences(references,qcpID) VALUES ('" & Me.txtreferences & "','" & _
Me.txtQcp & "' )"
DoCmd.RunSQL sql
---notworking-------------------------------------------------------------
Private Sub cmdDeletelist2_Click()
Dim sql As String
sql = "Delete from tblreferences where refID = " & Me.ID & _
" AND UserId = " & Forms.frmqcpList2.txtQcp
DoCmd.RunSQL sql
DoCmd.RunSQL sql
Me.Requery
End Sub
I have a text box to insert new references . I am trying to create a command button to delete references I want from the subform, but cannot seem to get it to work. Here is the code I have
working
Dim sql As String
sql = "INSERT INTO tblreferences(references,qcpID) VALUES ('" & Me.txtreferences & "','" & _
Me.txtQcp & "' )"
DoCmd.RunSQL sql
---notworking-------------------------------------------------------------
Private Sub cmdDeletelist2_Click()
Dim sql As String
sql = "Delete from tblreferences where refID = " & Me.ID & _
" AND UserId = " & Forms.frmqcpList2.txtQcp
DoCmd.RunSQL sql
DoCmd.RunSQL sql
Me.Requery
End Sub