Solved

NotInList Not working properly

Posted on 2013-11-05
5
305 Views
Last Modified: 2013-11-05
I have a combo box on my form with the "NotInList" event firing this code:

    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

Open in new window


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?
0
Comment
Question by:Lawrence Salvucci
5 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39623970
Your code and method seem to be working fine for me.  The issue might be in your dialog box rather than the code you posted here.

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.
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39623996
I don't see anything wrong either.   I would do a /decompile first (which is a command line switch).

That will cleanout the compiled code (do a backup first).  Also do a compile and make sure your error free after that.

Details can be found here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_2043-Decompile-What-it-is-what-it-does-and-how-to-use-it.html

Jim.
0
 
LVL 57
ID: 39623997
BTW, what's the rowsource of the combo?  Query/table or SQL statement your building on the fly?

Jim.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39624233
what version of access are you using?
0
 
LVL 1

Author Comment

by:Lawrence Salvucci
ID: 39626022
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.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question