PC Review


Reply
Thread Tools Rate Thread

Combo Box - NotInList

 
 
Stapes
Guest
Posts: n/a
 
      22nd Mar 2007
Hi

I am trying to use a Combo box to allow a user to choose an existing
Company name & address, or add a new one. The bound column is the
Company name. I have used the NotInList property and put in an event
procedure here. The trouble is, it never gets activated. I have
entered names that are not on the list. Also, one name I am trying to
enter is CONTAINED within another name, i.e. I want to enter "Home",
but "Home Delivery Network" already exists. The rest of "Home Delivery
Network" appears in the Combo Box, but I delete it. Still doesn't
trigger my event procedure.

Any idea why this is happening?

Stapes

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      22nd Mar 2007
Did you remember to set the combo box's LimitToList property to True?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Stapes" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I am trying to use a Combo box to allow a user to choose an existing
> Company name & address, or add a new one. The bound column is the
> Company name. I have used the NotInList property and put in an event
> procedure here. The trouble is, it never gets activated. I have
> entered names that are not on the list. Also, one name I am trying to
> enter is CONTAINED within another name, i.e. I want to enter "Home",
> but "Home Delivery Network" already exists. The rest of "Home Delivery
> Network" appears in the Combo Box, but I delete it. Still doesn't
> trigger my event procedure.
>
> Any idea why this is happening?
>
> Stapes
>



 
Reply With Quote
 
Stapes
Guest
Posts: n/a
 
      22nd Mar 2007
On 22 Mar, 15:10, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
> Did you remember to set the combo box's LimitToList property to True?
>
> --
> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
> (no e-mails, please!)
>



Surely you mean set the LimitToList property to No? I have already
done that.

Stapes

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      22nd Mar 2007
"Stapes" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 22 Mar, 15:10, "Douglas J. Steele"
> <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
>> Did you remember to set the combo box's LimitToList property to True?
>>
>> --
>> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
>> (no e-mails, please!)
>>

>
>
> Surely you mean set the LimitToList property to No? I have already
> done that.


No, I meant True (Yes if you're doing it through the Properties window).

The NotInList event doesn't fire unless you've told Access that you only
want to use values that are in the combo box.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)



 
Reply With Quote
 
Stapes
Guest
Posts: n/a
 
      23rd Mar 2007
On 22 Mar, 20:31, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
> "Stapes" <steve.sta...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
> > On 22 Mar, 15:10, "Douglas J. Steele"
> > <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
> >> Did you remember to set the combo box's LimitToList property to True?

>
> >> --
> >> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
> >> (no e-mails, please!)

>
> > Surely you mean set the LimitToList property to No? I have already
> > done that.

>
> No, I meant True (Yes if you're doing it through the Properties window).
>
> The NotInList event doesn't fire unless you've told Access that you only
> want to use values that are in the combo box.
>
> --
> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
> (no private e-mails, please)


Hi Again

OK. I set my LimitToList property to True. My NotInList event gets
triggered & does what it's told - i.e. displays a message asking the
user to input address details. But then, I get the message "The text
you entered isn't an item in the list" and the focus has gone back to
that field.
If the item does not exist in the list - I want to create a new
customer record.

Stapes

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      23rd Mar 2007
"Stapes" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 22 Mar, 20:31, "Douglas J. Steele"
> <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
>> "Stapes" <steve.sta...@gmail.com> wrote in message
>>
>> news:(E-Mail Removed)...
>>
>> > On 22 Mar, 15:10, "Douglas J. Steele"
>> > <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
>> >> Did you remember to set the combo box's LimitToList property to True?

>>
>> >> --
>> >> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
>> >> (no e-mails, please!)

>>
>> > Surely you mean set the LimitToList property to No? I have already
>> > done that.

>>
>> No, I meant True (Yes if you're doing it through the Properties window).
>>
>> The NotInList event doesn't fire unless you've told Access that you only
>> want to use values that are in the combo box.
>>
>> --
>> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
>> (no private e-mails, please)

>
> Hi Again
>
> OK. I set my LimitToList property to True. My NotInList event gets
> triggered & does what it's told - i.e. displays a message asking the
> user to input address details. But then, I get the message "The text
> you entered isn't an item in the list" and the focus has gone back to
> that field.
> If the item does not exist in the list - I want to create a new
> customer record.


What's the code you've got in your NotInList event?

Assuming that you've already got a customer creation form, your NotInList
event should prompt the user to ensure that they really do want to add a
record (in case it was just a typo) and then open the customer creation form
modally (i.e.: use the acDialog constant in conjunction with the OpenForm
method). The "trick" is to know when they've actually created a new customer
vs. when they've decided to cancel the creation process for some reason.
What I often do is create a property on the calling form (something like
"RecordAdded") and set it to False before calling the creation form. When I
call the creation form, I pass it the name of the form that's calling it. In
the Click event of the Close button on the creation form, I put logic that
determines whether or not the form was called from another form (i.e.: I
check the form's OpenArgs property) and update the RecordAdded property of
the calling form. In the calling form's NotInList event, I can then check to
see the value of RecordAdded., and set the value of Response appropriately.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



 
Reply With Quote
 
=?Utf-8?B?c2N1YmFkaXZlcg==?=
Guest
Posts: n/a
 
      18th May 2007

Download the mdb from here. It may help.

http://www.rogersaccesslibrary.com/d...=NotInList.mdb



"Stapes" wrote:

> On 22 Mar, 20:31, "Douglas J. Steele"
> <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
> > "Stapes" <steve.sta...@gmail.com> wrote in message
> >
> > news:(E-Mail Removed)...
> >
> > > On 22 Mar, 15:10, "Douglas J. Steele"
> > > <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
> > >> Did you remember to set the combo box's LimitToList property to True?

> >
> > >> --
> > >> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
> > >> (no e-mails, please!)

> >
> > > Surely you mean set the LimitToList property to No? I have already
> > > done that.

> >
> > No, I meant True (Yes if you're doing it through the Properties window).
> >
> > The NotInList event doesn't fire unless you've told Access that you only
> > want to use values that are in the combo box.
> >
> > --
> > Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
> > (no private e-mails, please)

>
> Hi Again
>
> OK. I set my LimitToList property to True. My NotInList event gets
> triggered & does what it's told - i.e. displays a message asking the
> user to input address details. But then, I get the message "The text
> you entered isn't an item in the list" and the focus has gone back to
> that field.
> If the item does not exist in the list - I want to create a new
> customer record.
>
> Stapes
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo NotInList Dave Microsoft Access 2 1st May 2008 06:25 PM
Combo 'NotInList' > add record > refresh combo problem Fjordur Microsoft Access Forms 3 27th Jan 2006 09:09 PM
Combo Box and NotInList Barb St. Clair Microsoft Access Database Table Design 2 17th Mar 2004 04:12 PM
Using NotInList with Combo Box Hilary Ostrov Microsoft Access Getting Started 1 6th Feb 2004 10:31 AM
When does Combo NotInList Fire? Warren Bell Microsoft Access Form Coding 7 26th Jul 2003 03:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:48 PM.