Lawrence Salvucci
asked on
NotInList Not working properly
I have a combo box on my form with the "NotInList" event firing this code:
I've used this code many times in the past but for some reason after they close the pop-up form to enter the new owner into the table I get the "The text you entered isn't an item in the list" error. Then when you open the pull down on the combo you can clearly see that entry in the list. I have other databases that use this exact function and work fine. The combo box is bound to column 1 which is a "number" datatype. What also happens is after you click ok on the error message and then select the new entry from the pull down list and then tab out of that control the field goes blank but when you close and open the form the value is there. Something funky is going on and I can't figure it out. What am I missing?
If MsgBox("Do you want to add this OWNER to the list?", vbYesNo) = vbYes Then
DoCmd.OpenForm "frmOwnerAdd", , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
I've used this code many times in the past but for some reason after they close the pop-up form to enter the new owner into the table I get the "The text you entered isn't an item in the list" error. Then when you open the pull down on the combo you can clearly see that entry in the list. I have other databases that use this exact function and work fine. The combo box is bound to column 1 which is a "number" datatype. What also happens is after you click ok on the error message and then select the new entry from the pull down list and then tab out of that control the field goes blank but when you close and open the form the value is there. Something funky is going on and I can't figure it out. What am I missing?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BTW, what's the rowsource of the combo? Query/table or SQL statement your building on the fly?
Jim.
Jim.
what version of access are you using?
ASKER
Sorry for the delay in posting back. I did a /decompile and that worked. Something must have been getting hung up somewhere but all is well now. Thank you for the quick responses.
Can you post a sample database with just the relevant forms/queries/tables showing this issue? Strip it of any sensitive data or features before posting it.