Not in List Event

R

Ray C

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
 
K

Ken Snell [MVP]

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.
 
R

Ray C

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
 
L

Lostguy

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
 
A

Arvin Meyer [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top