Mavila
06-21-2018, 10:27 AM
I have a record that I'm UPDATING like so:
num = 9
cmdTypeUpdate = "UPDATE [Classes] SET [Type] = '2', [Legal Duration] = '" & num & "' WHERE [ID] = '" & cmb.ListIndex & "'
cn.execute (cmdTypeUpdate)
That works - it updates the record with the appropriate values.
However, the macro then goes on to refresh a listbox with a SELECT statement, like so:
lstSELECT = "SELECT [ClassNm], [Legal Duration], [Policy Duration] FROM [Classes]"
and the value for myrecordset.fields(1) is not 9, but is always 0. If I stop/reset the macro, then the SELECT statement works fine retrieving 9 from the field in the database.
Any ideas what may be going on here? Thank you.
num = 9
cmdTypeUpdate = "UPDATE [Classes] SET [Type] = '2', [Legal Duration] = '" & num & "' WHERE [ID] = '" & cmb.ListIndex & "'
cn.execute (cmdTypeUpdate)
That works - it updates the record with the appropriate values.
However, the macro then goes on to refresh a listbox with a SELECT statement, like so:
lstSELECT = "SELECT [ClassNm], [Legal Duration], [Policy Duration] FROM [Classes]"
and the value for myrecordset.fields(1) is not 9, but is always 0. If I stop/reset the macro, then the SELECT statement works fine retrieving 9 from the field in the database.
Any ideas what may be going on here? Thank you.