Help!

Not in List Event

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Getting Started RSS
Next:  appointment!  
Author Message
Ray C
External


Since: Jul 15, 2006
Posts: 96



PostPosted: Sun Aug 30, 2009 1:25 am    Post subject: Not in List Event
Archived from groups: microsoft>public>access>gettingstarted (more info?)

I have 4 Combo boxes as find boxes and I want to trap and process any input
that is not listed in the Comb drop down. Currently i have the following to
handle each combo box and pass the info on to a sub routine called
"Not_In_List()" to handle the event. Is there ant way to tidy this up amd
have just one routine to handle all of the Find Boxes?

Private Sub cmb_Find_Box_1_NotInList(NewData As String, Response As Integer)

Call Not_In_List(NewData, Response, 1)

End Sub

Private Sub cmb_Find_Box_2_NotInList(NewData As String, Response As Integer)

Call Not_In_List(NewData, Response, 2)

End Sub

Private Sub cmb_Find_Box_3_NotInList(NewData As String, Response As Integer)

Call Not_In_List(NewData, Response, 3)

End Sub

Private Sub cmb_Find_Box_4_NotInList(NewData As String, Response As Integer)

Call Not_In_List(NewData, Response, 4)

End Sub

Thanks for any help. Regards Ray C
Back to top
Ken Snell [MVP]
External


Since: Aug 18, 2004
Posts: 1522



PostPosted: Sun Aug 30, 2009 8:01 am    Post subject: Re: Not in List Event [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

When you say "tidy this up", are you wanting to have a single procedure call
that is 'activated' by any of the four combo boxes? If that is what you
seek, then no. Each combo box's NotInList event procedure must be separate
in your code.

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


"Ray C" <RayC.RemoveThis@discussions.microsoft.com> wrote in message
news:590BC2D4-39A4-4E0B-8EFB-AE0481193398@microsoft.com...
>I have 4 Combo boxes as find boxes and I want to trap and process any input
> that is not listed in the Comb drop down. Currently i have the following
> to
> handle each combo box and pass the info on to a sub routine called
> "Not_In_List()" to handle the event. Is there ant way to tidy this up amd
> have just one routine to handle all of the Find Boxes?
>
> Private Sub cmb_Find_Box_1_NotInList(NewData As String, Response As
> Integer)
>
> Call Not_In_List(NewData, Response, 1)
>
> End Sub
>
> Private Sub cmb_Find_Box_2_NotInList(NewData As String, Response As
> Integer)
>
> Call Not_In_List(NewData, Response, 2)
>
> End Sub
>
> Private Sub cmb_Find_Box_3_NotInList(NewData As String, Response As
> Integer)
>
> Call Not_In_List(NewData, Response, 3)
>
> End Sub
>
> Private Sub cmb_Find_Box_4_NotInList(NewData As String, Response As
> Integer)
>
> Call Not_In_List(NewData, Response, 4)
>
> End Sub
>
> Thanks for any help. Regards Ray C
Back to top
Ray C
External


Since: Jul 15, 2006
Posts: 96



PostPosted: Sun Aug 30, 2009 8:36 am    Post subject: Re: Not in List Event [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the respmse Ken. I kind of thought so but I just wanted to tidy up
the code if at all possible.
Once more, thanks for your kind help.

Regards Ray C


"Ken Snell [MVP]" wrote:

> When you say "tidy this up", are you wanting to have a single procedure call
> that is 'activated' by any of the four combo boxes? If that is what you
> seek, then no. Each combo box's NotInList event procedure must be separate
> in your code.
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
> http://www.accessmvp.com/KDSnell/
>
>
> "Ray C" <RayC.TakeThisOut@discussions.microsoft.com> wrote in message
> news:590BC2D4-39A4-4E0B-8EFB-AE0481193398@microsoft.com...
> >I have 4 Combo boxes as find boxes and I want to trap and process any input
> > that is not listed in the Comb drop down. Currently i have the following
> > to
> > handle each combo box and pass the info on to a sub routine called
> > "Not_In_List()" to handle the event. Is there ant way to tidy this up amd
> > have just one routine to handle all of the Find Boxes?
> >
> > Private Sub cmb_Find_Box_1_NotInList(NewData As String, Response As
> > Integer)
> >
> > Call Not_In_List(NewData, Response, 1)
> >
> > End Sub
> >
> > Private Sub cmb_Find_Box_2_NotInList(NewData As String, Response As
> > Integer)
> >
> > Call Not_In_List(NewData, Response, 2)
> >
> > End Sub
> >
> > Private Sub cmb_Find_Box_3_NotInList(NewData As String, Response As
> > Integer)
> >
> > Call Not_In_List(NewData, Response, 3)
> >
> > End Sub
> >
> > Private Sub cmb_Find_Box_4_NotInList(NewData As String, Response As
> > Integer)
> >
> > Call Not_In_List(NewData, Response, 4)
> >
> > End Sub
> >
> > Thanks for any help. Regards Ray C
>
>
>
Back to top
Arvin Meyer [MVP]
External


Since: Jan 09, 2009
Posts: 74



PostPosted: Sun Aug 30, 2009 8:35 pm    Post subject: Re: Not in List Event [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You can have a generic NotInList event, but you'll need to call it for each
NotInList event on each combo. Here's some Generic NotInList code:

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

and here's a demo of how to use it:

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" <RayC.TakeThisOut@discussions.microsoft.com> wrote in message
news:11EA0C9F-B4CF-4790-8E45-458E81448008@microsoft.com...
> Thanks for the respmse Ken. I kind of thought so but I just wanted to tidy
> up
> the code if at all possible.
> Once more, thanks for your kind help.
>
> Regards Ray C
>
>
> "Ken Snell [MVP]" wrote:
>
>> When you say "tidy this up", are you wanting to have a single procedure
>> call
>> that is 'activated' by any of the four combo boxes? If that is what you
>> seek, then no. Each combo box's NotInList event procedure must be
>> separate
>> in your code.
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>> http://www.accessmvp.com/KDSnell/
>>
>>
>> "Ray C" <RayC.TakeThisOut@discussions.microsoft.com> wrote in message
>> news:590BC2D4-39A4-4E0B-8EFB-AE0481193398@microsoft.com...
>> >I have 4 Combo boxes as find boxes and I want to trap and process any
>> >input
>> > that is not listed in the Comb drop down. Currently i have the
>> > following
>> > to
>> > handle each combo box and pass the info on to a sub routine called
>> > "Not_In_List()" to handle the event. Is there ant way to tidy this up
>> > amd
>> > have just one routine to handle all of the Find Boxes?
>> >
>> > Private Sub cmb_Find_Box_1_NotInList(NewData As String, Response As
>> > Integer)
>> >
>> > Call Not_In_List(NewData, Response, 1)
>> >
>> > End Sub
>> >
>> > Private Sub cmb_Find_Box_2_NotInList(NewData As String, Response As
>> > Integer)
>> >
>> > Call Not_In_List(NewData, Response, 2)
>> >
>> > End Sub
>> >
>> > Private Sub cmb_Find_Box_3_NotInList(NewData As String, Response As
>> > Integer)
>> >
>> > Call Not_In_List(NewData, Response, 3)
>> >
>> > End Sub
>> >
>> > Private Sub cmb_Find_Box_4_NotInList(NewData As String, Response As
>> > Integer)
>> >
>> > Call Not_In_List(NewData, Response, 4)
>> >
>> > End Sub
>> >
>> > Thanks for any help. Regards Ray C
>>
>>
>>
Back to top
Lostguy
External


Since: Jul 23, 2009
Posts: 4



PostPosted: Mon Aug 31, 2009 5:28 pm    Post subject: Re: Not in List Event [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mr. Meyer,

I checked out your demo and had a question about what you did that
might improve what I am working on:

On your forms, your have the CustomerID and EventID there, but not
visible. What would be the advantage/use of that?

VR/Lost
Back to top
Arvin Meyer [MVP]
External


Since: Jan 09, 2009
Posts: 74



PostPosted: Mon Aug 31, 2009 9:09 pm    Post subject: Re: Not in List Event [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Because the IDs do not matter to the user interface. I also wanted to make
sure that the first physical textbox to gain focus on the customer's form
was the customer name so that it would be filled by the value typed into the
events form. That avoids having to type it again, it's just passed (using
OpenArgs) from the combo on the events form to the customer name textbox in
the customers form.

This is often difficult for non-database architects to understand. The IDs
are keys for connecting data. 99.99% of the time they should have no meaning
to any value in the table. Do not use autonumbers for anything meaningful.
You will be disappointed when left with gaps or missing values.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Lostguy" <cpocpo.TakeThisOut@mail.com> wrote in message
news:72042045-eaa3-49ec-91d1-4d4c8c9ec2dd@e34g2000vbm.googlegroups.com...
> Mr. Meyer,
>
> I checked out your demo and had a question about what you did that
> might improve what I am working on:
>
> On your forms, your have the CustomerID and EventID there, but not
> visible. What would be the advantage/use of that?
>
> VR/Lost
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Getting Started All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum