Too many Ifs

olorin

Registered User.
Local time
Today, 18:59
Joined
Jun 9, 2006
Messages
81
I have a simple form with a Combo box on it acting as a drop down list so the user can select a customer name. Once they select a customer name they click a button on the form to open a report based on the customer they selected.
All works fine.
The problem is, there are 41 customers to choose from, and I have got the button to decide which customer they selected by having 41 "IF" statements in the code.
Surely there must be an easier way.
Also, if a new customer is added to the database, then I would also have to add another "IF" statement to the code.
Any help would be appreciated, (41 times over) :)
 
Hi -

Look up the OpenArgs Property in the helf file. There are examples that should help clarify.

Bob
 
It would be better for you to post code of your button here.
 
Thanx very much for pointing me in the right direction.
The OpenArgs Property did the trick.
I knew there must have been an easier way!
But being a complete novice at coding and Database building I was struggling.
It's only with some great help and advice from here that I have managed to get as far as I am!
Thanx again.
 
Olorin -

Glad it worked for you.

Best Wishes, Bob
 

Users who are viewing this thread

Back
Top Bottom