G
Guest
I am trying to save a text box content back to a table.
I currently have a listbox that queries a previous button using this query.
SELECT tblSpecifics.SpecificID, tblSpecifics.SpecificName,
tblSpecifics.txtDescription
FROM tblSpecifics
WHERE (((tblSpecifics.CategoryID)=[forms]![Main]![cboCategory]));
Then, I have it set to make a textbox equal column 2, to display the memo
field containing the data
Private Sub cboSpecifics_Click()
Me.txtDescription.Value = Me.cboSpecifics.Column(2)
End Sub
When a user is finished modifying the data, I want it to automatically save
back to the table, no buttons to click, or user intervention, but I'm having
troubles doing so.
I'm trying this, but with no results.
Private Sub txtDescription_Exit(Cancel As Integer)
'Dim db As Database
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Select * from tblSpecifics where
SpecificName=" & Me.cboSpecifics)
rst.Edit
rst!txtDscription = txtDescription
rst.Update
rst.Close
Set rst = Nothing
End Sub
Any assistance would be appreciated, no rush, this is a learning curve for me.
I currently have a listbox that queries a previous button using this query.
SELECT tblSpecifics.SpecificID, tblSpecifics.SpecificName,
tblSpecifics.txtDescription
FROM tblSpecifics
WHERE (((tblSpecifics.CategoryID)=[forms]![Main]![cboCategory]));
Then, I have it set to make a textbox equal column 2, to display the memo
field containing the data
Private Sub cboSpecifics_Click()
Me.txtDescription.Value = Me.cboSpecifics.Column(2)
End Sub
When a user is finished modifying the data, I want it to automatically save
back to the table, no buttons to click, or user intervention, but I'm having
troubles doing so.
I'm trying this, but with no results.
Private Sub txtDescription_Exit(Cancel As Integer)
'Dim db As Database
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Select * from tblSpecifics where
SpecificName=" & Me.cboSpecifics)
rst.Edit
rst!txtDscription = txtDescription
rst.Update
rst.Close
Set rst = Nothing
End Sub
Any assistance would be appreciated, no rush, this is a learning curve for me.