judyscofield
Programmer
I've put code in the 'On Not In List' event of a combo box that adds the entry to a codes table that the combo is based on. That works ok, but when I try to requery the combo box, I get the error 2118 - 'You must save the field before performing a requery.' Then I get the message that my choice isn't in the list. I'm not sure what it's expecting me to do. Code is:
Dim dbsInventory As Object
Dim rsGWID As Object
Set dbsInventory = CurrentDb
Set rsGWID = dbsInventory.OpenRecordSet("GWID"
With rsGWID
.AddNew
!GWID = NewData
.Update
End With
Dim ctlList As Control
Set ctlList = Forms![User Maintenance]!GWID
' Requery source of data for list box.
ctlList.Requery
Dim dbsInventory As Object
Dim rsGWID As Object
Set dbsInventory = CurrentDb
Set rsGWID = dbsInventory.OpenRecordSet("GWID"
With rsGWID
.AddNew
!GWID = NewData
.Update
End With
Dim ctlList As Control
Set ctlList = Forms![User Maintenance]!GWID
' Requery source of data for list box.
ctlList.Requery