Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Limit to List

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ivor Williams - 18 Dec 2007 03:18 GMT
I have a form frmOrder with an unbound combo box cboPartNo, with the
Limit to List property set to Yes. In the "On Not in List" event, I've added
the following:

DoCmd.OpenForm "frmNewPart", , , , , acDialog
   Response = acDataErrAdded

When I enter a new part number in the combo box, the form frmNewPart opens
as expected, but when I try to close the form, I get the following message:

"The text you entered isn't an item in the list.
Select an item from the list, or enter text that matches one of the listed
items."

Then the frmNewPart form closes without updating the information in the
frmOrder form.

I've tried changing the Limit to List" property to No, but it didn't solve
the problem.

Ivor
Allen Browne - 18 Dec 2007 06:05 GMT
Which is the Bound Column of the combo?
Is this the display column?

When the combo's NotInList event fires, the NewData argument passes the
value the user typed into the combo. If this is not the value that gets
stored in the Bound Column, your approach won't work.

For example, a typical combo has properties like this:
   Control Source        CategoryID
   RowSource             SELECT CategoryID, CategoryName FROM tblCategory;
   Bound Column        1
   Column Widths       0
Then the user enters a new category (text), which is *not* what goes in the
CategoryID column (number.) If this is what you are doing, the NotInList
event will not work. You need to provide another mechanism for adding new
items, such as a command button beside the combo, or its DblClick event.

Access 2007 allows you to specify the form to use to add items to the
combo's source table. You can then right-click the combo to add items.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>   I have a form frmOrder with an unbound combo box cboPartNo, with the
> Limit to List property set to Yes. In the "On Not in List" event, I've
[quoted text clipped - 18 lines]
>
> Ivor
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.