A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Not in List Event



 
 
Thread Tools Display Modes
  #1  
Old August 30th, 2009, 09:25 AM posted to microsoft.public.access.gettingstarted
Ray C
external usenet poster
 
Posts: 215
Default Not in List Event

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
  #2  
Old August 30th, 2009, 01:01 PM posted to microsoft.public.access.gettingstarted
Ken Snell [MVP]
external usenet poster
 
Posts: 279
Default Not in List Event

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" wrote in message
...
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



  #3  
Old August 30th, 2009, 04:36 PM posted to microsoft.public.access.gettingstarted
Ray C
external usenet poster
 
Posts: 215
Default Not in List Event

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" wrote in message
...
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




  #4  
Old August 31st, 2009, 01:35 AM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Not in List Event

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" wrote in message
...
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" wrote in message
...
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






  #5  
Old September 1st, 2009, 01:28 AM posted to microsoft.public.access.gettingstarted
Lostguy
external usenet poster
 
Posts: 73
Default Not in List Event

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
  #6  
Old September 1st, 2009, 02:09 AM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Not in List Event

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" wrote in message
...
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



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.