View Full Version : Combo-box range of values (0 thru 60)


ZanyJanie
11-19-2001, 08:38 AM
Hi All,

Does anyone know of an easy way to specify a range of values for a combo-box without creating a separate table or actually typing each value in the value list. In my case, I need the numbers 0 thru 60 ... one combo-box has the numbers in ascending order, and another has them descending.

0;1;2;3;4;5;...60
60;59;58;57; ...0 (you get the idea)

BTW, I do realize that it would be easier to just have the user type in the desired value; but I also need to be able to use the "limit to list" restriction.

Thanks, in advance, for your help.

jwindon
11-19-2001, 09:49 AM
Why not put in a text box control and set the validation for that control to >=0 and <= 60 instead of using a combo box?

[This message has been edited by jwindon (edited 11-19-2001).]

The_Doc_Man
11-19-2001, 10:04 AM
You could also do something like a spin-control with limits of 0 to 60. It is one of the extended controls. Has two little arrows (one up, one down) and a text box as a single control.

But the other suggest, a text box with validation rules, also should work fine.

ZanyJanie
11-19-2001, 12:05 PM
Thanks for the suggestions.

As for using a text box ... it won't allow me to restrict the user input to integers only. I tried setting the text box decimal places to 0 and then typed a value of 1.5. On the form, I see a displayed value of 2; but when I use the form's combo-box as the selection criteria within a query, Access retrieves the records that match the actual 1.5 value.

Using a spinner sounded promising; but I seem to be stuck again. When I adding a Microsoft Forms 2.0 spinbutton object to my form, I got the up/down buttons; but no associated ... textbox. In checking the Microsoft Knowledge Base, they said the ActiveX control has been replaced by the Microsoft UpDown control. When I tried that control, I got an error saying I didn't have a license for that control.

Got any other suggestions?

If all else fails, hard coding the values does work!

Thanks again.

jwindon
11-19-2001, 01:12 PM
Try using an input mask on the text box to control the users input to only 2 characters.

ZanyJanie
11-19-2001, 01:56 PM
Thanks again! Using the validation rule, together with the input mask, did the trick.