I have a list box (Device) that is populated by a table (M_tbl)
and I would like to have the User click a button to select the
record of the table that is shown in the list box so that a
field of that record can be modified.
My list box row source looks like this:
Code:
SELECT D.Assembly, D.Description, FROM M_tbl AS D
ORDER BY D.Assembly;
I tried to set up the code to do this but I am not sure how to
select the correct record as it is displayed in the list box...
Code:
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
strSQL = "SELECT M_tbl.Assembly, M_tbl.Description, FROM M_tbl; "
Set rst = dbs.OpenRecordset(strSQL)
If rst.EOF = False Or rst.BOF = False Then
With rst
.Edit
!Description = "Obsolete"
.Update
End With
rst.close ' Close the recordset.
Any suggestions?
Thanks