PC Review


Reply
Thread Tools Rate Thread

Determing if user input is on list in Combo Box

 
 
=?Utf-8?B?Sm9lIER1bmZlZQ==?=
Guest
Posts: n/a
 
      19th Jul 2007
I have a combo box that lists all standard sizes for an item we manufacture.
It is set to allow the user to input a value not on the list if they desire.
However, if they input their own size, I need to determine this, so I can
charge for a non-standard size.

Note that I am trying to make a generic VBA routine that I can use in both
Excel and AutoCAD, so I don't want to use any Excel specific commands. I have
populated my combo box with a command like this;

Dim StdSizes(100,100,100)
'Then I populate the array with inches, feet-inch, and meters for out
standard sizes
Combo1.Column() = StdSizes

I imagine I can use a Combo1_Change() event to determine when the user is
finished typing, and then compare the new value of the combo box to all the
values in the array to see if there are any matches.

Any other methods you can recommend?

Joe Dunfee
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lIER1bmZlZQ==?=
Guest
Posts: n/a
 
      23rd Jul 2007
Since I am dependent on the wisdom others have provided here, I feel it was
important to contribute my own advice (even if I am not as experienced as
other) I think i've found a better solution.

I've gone with a for-next loop that compares the user input to every item in
the list (which is stored in an array). I have been doing this comparison
for every character the user types. It performs better than I expected.
However, now will be changing to detecting the Enter key to start my
comparison loop by using the following command;

onkey (~,MyCompareProcedure) ' note that the Tilde is equivalent to the
Enter key.

Joe Dunfee
 
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
user input via combo box in VBA =?Utf-8?B?RG91ZyBGLg==?= Microsoft Access VBA Modules 0 10th Mar 2006 07:50 PM
How can I calculate user input from a combo box into a formula? =?Utf-8?B?UXVpemJveQ==?= Microsoft Excel Worksheet Functions 0 16th Nov 2005 06:11 PM
List box / Combo box to match input Tom Knapp via AccessMonster.com Microsoft Access Getting Started 1 19th Jun 2005 11:04 PM
Combo Box - Forcing user to input from the list =?Utf-8?B?TG91?= Microsoft Outlook Form Programming 1 20th May 2004 12:33 PM
input parameter on rowsource of combo/list? Joe Clarke Microsoft Access ADP SQL Server 1 13th Feb 2004 03:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:50 AM.