S
ScubaSteve
This board has been incredibly helpful with my database, so I thought I
would give this another shot.
I've got an insert into statement that I don't understand fully. I
want items selected in a listbox, on dblclick, to be inserted into a
table. Here is my statement.
Private Sub lstProblem_DblClick(Cancel As Integer)
Dim strSQL As String
strSQL = "INSERT INTO tPatientDiagnoses([DiagnosisID],
[DiagnosisName]) VALUES (" _
& Me.LstProblem.Column(0) & ", " _
& Me.LstProblem.Column(1) & ")"
CurrentDb.Execute strSQL, dbFailOnError
End Sub
This is on a subform (linked to tpatientDiagnoses) and the items in the
listbox are items available that should be appended to the record using
CaseID and PatientID (composite). The master and child fields are set
up correctly in the subform as far as I know.
tpatientDiagnoses fields look like this:
CaseID : PatientID : DiagnosisID :
DiagnosisName
The listbox this is coming from has multiple columns (4) since it based
on a selection in a combobox.
Eventually I want the items appended to the table to appear in another
listbox.
Thanks!
would give this another shot.
I've got an insert into statement that I don't understand fully. I
want items selected in a listbox, on dblclick, to be inserted into a
table. Here is my statement.
Private Sub lstProblem_DblClick(Cancel As Integer)
Dim strSQL As String
strSQL = "INSERT INTO tPatientDiagnoses([DiagnosisID],
[DiagnosisName]) VALUES (" _
& Me.LstProblem.Column(0) & ", " _
& Me.LstProblem.Column(1) & ")"
CurrentDb.Execute strSQL, dbFailOnError
End Sub
This is on a subform (linked to tpatientDiagnoses) and the items in the
listbox are items available that should be appended to the record using
CaseID and PatientID (composite). The master and child fields are set
up correctly in the subform as far as I know.
tpatientDiagnoses fields look like this:
CaseID : PatientID : DiagnosisID :
DiagnosisName
The listbox this is coming from has multiple columns (4) since it based
on a selection in a combobox.
Eventually I want the items appended to the table to appear in another
listbox.
Thanks!