PC Review


Reply
Thread Tools Rate Thread

Combo - Not in List Event

 
 
Ray C
Guest
Posts: n/a
 
      28th Dec 2009
Would anyone be able to help me with any explanation as to why my Combo
"NotInList" Event refuses to work?
The Combo seems to work fine when providing a list of iems to select from
but I want to provide the user with a method of entering somenting that is
not in the underlying Table and thereby habing the option to create a new
record. I though that "NotIn List" would be the way to do it. By using the
"NotInList" Event for the Combo, the program should pick up that the item is
not in the Table and ask the user if they want to create a new record. I have
tried all I know (which isn't much) but despite everything if I enter
something that is in the Table the program goes to the combo "AfterUpdate"
Event but if I enter something in the Combo that is not in the Table, it
still goes to the "AfterUpdate" Event (and returns an error) whereas it
should go to the "NotInLis" routine. I have repeatedly enterered, scrubbed
out and re-entered the "NotInList" Event in the Properties for that Combo.

Any help Appreciated RayC
 
Reply With Quote
 
 
 
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      28th Dec 2009
Try using the generic code at:

http://www.datastrat.com/Code/NotInListCode.txt

There's a demo database of it at:

http://www.accessmvp.com/Arvin/NotInListDemo.zip
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Ray C" <(E-Mail Removed)> wrote in message
news:017BD74A-73CC-478F-B0AF-(E-Mail Removed)...
> Would anyone be able to help me with any explanation as to why my Combo
> "NotInList" Event refuses to work?
> The Combo seems to work fine when providing a list of iems to select from
> but I want to provide the user with a method of entering somenting that is
> not in the underlying Table and thereby habing the option to create a new
> record. I though that "NotIn List" would be the way to do it. By using the
> "NotInList" Event for the Combo, the program should pick up that the item
> is
> not in the Table and ask the user if they want to create a new record. I
> have
> tried all I know (which isn't much) but despite everything if I enter
> something that is in the Table the program goes to the combo "AfterUpdate"
> Event but if I enter something in the Combo that is not in the Table, it
> still goes to the "AfterUpdate" Event (and returns an error) whereas it
> should go to the "NotInLis" routine. I have repeatedly enterered, scrubbed
> out and re-entered the "NotInList" Event in the Properties for that Combo.
>
> Any help Appreciated RayC



 
Reply With Quote
 
Ray C
Guest
Posts: n/a
 
      29th Dec 2009
Thanks for your input guys. my version follows your various examples but, in
my program, if I enter something that is NOT in the dropdown list, the
program goes to the "AfterUpdate" routine as normal. I can not get the
program to go to my "NotInList" routine if I enter something in the Combo
that is not in the Combo List.
I just wodered if anyone had come accross this before and if the was a known
reason as to why this would happen
regards RayC

"ruralguy via AccessMonster.com" wrote:

> Here's one of my NotInList events for a similar situation:
>
>
> Private Sub cboSupplier_NotInList(NewData As String, Response As Integer)
> '-- We may need to add another Supplier
> Response = MsgBox("[" & NewData & "] is not yet a Supplier..." & vbCr &
> vbCr & _
> "Would you like to add a New Supplier to your DataBase?",
> vbYesNo)
>
> If Response = vbYes Then
> '-- Create a new Supplier record
> Dim db As DAO.Database
> Dim MySQL As String
> Set db = CurrentDb()
> MySQL = "Insert Into tblSuppliers(CoName,PriCat) " & _
> "Values(""" & NewData & """,27)"
> db.Execute MySQL, dbFailOnError
> Set db = Nothing
> Response = acDataErrAdded
> Else
> Response = acDataErrContinue
> End If
>
> End Sub
>
>
> Ray C wrote:
> >Would anyone be able to help me with any explanation as to why my Combo
> >"NotInList" Event refuses to work?
> >The Combo seems to work fine when providing a list of iems to select from
> >but I want to provide the user with a method of entering somenting that is
> >not in the underlying Table and thereby habing the option to create a new
> >record. I though that "NotIn List" would be the way to do it. By using the
> >"NotInList" Event for the Combo, the program should pick up that the item is
> >not in the Table and ask the user if they want to create a new record. I have
> >tried all I know (which isn't much) but despite everything if I enter
> >something that is in the Table the program goes to the combo "AfterUpdate"
> >Event but if I enter something in the Combo that is not in the Table, it
> >still goes to the "AfterUpdate" Event (and returns an error) whereas it
> >should go to the "NotInLis" routine. I have repeatedly enterered, scrubbed
> >out and re-entered the "NotInList" Event in the Properties for that Combo.
> >
> >Any help Appreciated RayC

>
> --
> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via http://www.accessmonster.com
>
> .
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      29th Dec 2009
Did you see Linq's post? Have you confirmed that the Limit To List property
is set to True?

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



"Ray C" <(E-Mail Removed)> wrote in message
news:FC0BBE06-2E5F-4960-86E8-(E-Mail Removed)...
> Thanks for your input guys. my version follows your various examples but,
> in
> my program, if I enter something that is NOT in the dropdown list, the
> program goes to the "AfterUpdate" routine as normal. I can not get the
> program to go to my "NotInList" routine if I enter something in the Combo
> that is not in the Combo List.
> I just wodered if anyone had come accross this before and if the was a
> known
> reason as to why this would happen
> regards RayC
>
> "ruralguy via AccessMonster.com" wrote:
>
>> Here's one of my NotInList events for a similar situation:
>>
>>
>> Private Sub cboSupplier_NotInList(NewData As String, Response As Integer)
>> '-- We may need to add another Supplier
>> Response = MsgBox("[" & NewData & "] is not yet a Supplier..." & vbCr
>> &
>> vbCr & _
>> "Would you like to add a New Supplier to your
>> DataBase?",
>> vbYesNo)
>>
>> If Response = vbYes Then
>> '-- Create a new Supplier record
>> Dim db As DAO.Database
>> Dim MySQL As String
>> Set db = CurrentDb()
>> MySQL = "Insert Into tblSuppliers(CoName,PriCat) " & _
>> "Values(""" & NewData & """,27)"
>> db.Execute MySQL, dbFailOnError
>> Set db = Nothing
>> Response = acDataErrAdded
>> Else
>> Response = acDataErrContinue
>> End If
>>
>> End Sub
>>
>>
>> Ray C wrote:
>> >Would anyone be able to help me with any explanation as to why my Combo
>> >"NotInList" Event refuses to work?
>> >The Combo seems to work fine when providing a list of iems to select
>> >from
>> >but I want to provide the user with a method of entering somenting that
>> >is
>> >not in the underlying Table and thereby habing the option to create a
>> >new
>> >record. I though that "NotIn List" would be the way to do it. By using
>> >the
>> >"NotInList" Event for the Combo, the program should pick up that the
>> >item is
>> >not in the Table and ask the user if they want to create a new record. I
>> >have
>> >tried all I know (which isn't much) but despite everything if I enter
>> >something that is in the Table the program goes to the combo
>> >"AfterUpdate"
>> >Event but if I enter something in the Combo that is not in the Table, it
>> >still goes to the "AfterUpdate" Event (and returns an error) whereas it
>> >should go to the "NotInLis" routine. I have repeatedly enterered,
>> >scrubbed
>> >out and re-entered the "NotInList" Event in the Properties for that
>> >Combo.
>> >
>> >Any help Appreciated RayC

>>
>> --
>> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
>> Please post back to this forum so all may benefit.
>>
>> Message posted via http://www.accessmonster.com
>>
>> .
>>


 
Reply With Quote
 
Ray C
Guest
Posts: n/a
 
      29th Dec 2009
Hi Doug

Jusst received that and he is spot on. I have set the properties as
suggessted and it is now working fine.

Thanks so much to everyone for their input. Regards Ray C

"Douglas J. Steele" wrote:

> Did you see Linq's post? Have you confirmed that the Limit To List property
> is set to True?
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Ray C" <(E-Mail Removed)> wrote in message
> news:FC0BBE06-2E5F-4960-86E8-(E-Mail Removed)...
> > Thanks for your input guys. my version follows your various examples but,
> > in
> > my program, if I enter something that is NOT in the dropdown list, the
> > program goes to the "AfterUpdate" routine as normal. I can not get the
> > program to go to my "NotInList" routine if I enter something in the Combo
> > that is not in the Combo List.
> > I just wodered if anyone had come accross this before and if the was a
> > known
> > reason as to why this would happen
> > regards RayC
> >
> > "ruralguy via AccessMonster.com" wrote:
> >
> >> Here's one of my NotInList events for a similar situation:
> >>
> >>
> >> Private Sub cboSupplier_NotInList(NewData As String, Response As Integer)
> >> '-- We may need to add another Supplier
> >> Response = MsgBox("[" & NewData & "] is not yet a Supplier..." & vbCr
> >> &
> >> vbCr & _
> >> "Would you like to add a New Supplier to your
> >> DataBase?",
> >> vbYesNo)
> >>
> >> If Response = vbYes Then
> >> '-- Create a new Supplier record
> >> Dim db As DAO.Database
> >> Dim MySQL As String
> >> Set db = CurrentDb()
> >> MySQL = "Insert Into tblSuppliers(CoName,PriCat) " & _
> >> "Values(""" & NewData & """,27)"
> >> db.Execute MySQL, dbFailOnError
> >> Set db = Nothing
> >> Response = acDataErrAdded
> >> Else
> >> Response = acDataErrContinue
> >> End If
> >>
> >> End Sub
> >>
> >>
> >> Ray C wrote:
> >> >Would anyone be able to help me with any explanation as to why my Combo
> >> >"NotInList" Event refuses to work?
> >> >The Combo seems to work fine when providing a list of iems to select
> >> >from
> >> >but I want to provide the user with a method of entering somenting that
> >> >is
> >> >not in the underlying Table and thereby habing the option to create a
> >> >new
> >> >record. I though that "NotIn List" would be the way to do it. By using
> >> >the
> >> >"NotInList" Event for the Combo, the program should pick up that the
> >> >item is
> >> >not in the Table and ask the user if they want to create a new record. I
> >> >have
> >> >tried all I know (which isn't much) but despite everything if I enter
> >> >something that is in the Table the program goes to the combo
> >> >"AfterUpdate"
> >> >Event but if I enter something in the Combo that is not in the Table, it
> >> >still goes to the "AfterUpdate" Event (and returns an error) whereas it
> >> >should go to the "NotInLis" routine. I have repeatedly enterered,
> >> >scrubbed
> >> >out and re-entered the "NotInList" Event in the Properties for that
> >> >Combo.
> >> >
> >> >Any help Appreciated RayC
> >>
> >> --
> >> RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
> >> Please post back to this forum so all may benefit.
> >>
> >> Message posted via http://www.accessmonster.com
> >>
> >> .
> >>

>
> .
>

 
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 box - not in list event SuzyQ Microsoft Access 5 1st Sep 2009 07:50 AM
Not in List Event in a combo box. =?Utf-8?B?QXJrUm95YWw=?= Microsoft Access Form Coding 1 20th Jun 2007 02:31 PM
Combo Box - Event Not in List xpnovice Microsoft Access Macros 3 11th May 2005 01:18 PM
Combo Box - On Not in List Event R. BRADFORD THOMAS Microsoft Access Form Coding 4 13th Jul 2004 12:35 PM
Not in List combo box event diarmuidq Microsoft Access Forms 5 5th Dec 2003 01:17 PM


Features
 

Advertising
 

Newsgroups
 


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