I see examples of how to read a list field but no example of how to write to one. I am taking an excel spreadsheet and importing it with code but one of my table fields is a list select field and the online example only shows how to read a field but not write to it. Can anyone give me an example of how to write to such a field? This is the link I am referencing: https://docs.microsoft.com/en-us/off...XAJwpzC2nK_7ek
In my code I thought I could simply look up the matching option from the option table and then record the value to the list field called "StyleOpt". But of course this doesn't work.
'//Lookup styles first in the style table and then save the ID to the table
'Dim rsSTY As DAO.Recordset2
'Dim fldSTY As DAO.Field2
'
'Set fldSTY = rsWIP("Style") <--- this is the list field
'
' Set rsSTY = modDB.DBWOP.OpenRecordset("SELECT * FROM tblWIPStyleOpt WHERE (([StyleOpt] = """ & xlSheet.Cells(i, 6).Value & """))", dbOpenDynaset)
'
' Select Case (rsSTY.EOF)
' Case False: rsWIP![Style] = rsSTY![StyleOpt]
' Case Else: rsWIP![Style] = Null
' End Select
'
' rsSTY.Close
' Set rsSTY = Nothing