Solved Creating combobox rowsource in quiry builder - sequantial number

jaryszek

Registered User.
Local time
Today, 11:48
Joined
Aug 25, 2016
Messages
756
Hi,

it is possible to not refer to already created query but to set up combobox values from 1 to 100 inside combobox source row property?
Can anybody help?

Best,
Jacek
 
Hi,

it is possible to not refer to already created query but to set up combobox values from 1 to 100 inside combobox source row property?
Can anybody help?

Best,
Jacek
Hi, could you try to describe your request a little bit more detailed?
Are you trying to make a combo box that shows all numbers 1-100?
I'm confused.
 
I'm as confused as mamradzelvy.

First thought is a value list with a loop because I'm too lazy to type it out.

in the OnEnter event

for i = 1 to 100
me.MyComboboxName.additem i
next i
 
you can specify Value List as your combo's Row Source Type.
you fill the values 1-100 on the Form's Load event:

private sub form_load()
dim i as byte
'me.combo.rowsource="1;2;3;4;5;6..."
'or
for i=1 to 100
me.combo.addItem i
next i
end sub
 
Well if he indeed wants a selector for the numbers 1-100, the most convenient method imho would be to have a textbox instead of a combo.
Then set the Validation Rule to : <=100 and then set the Validation Text to something in the lines of: XXX can not be a number higher than 100.
 
Last edited:
(just for fun)
I have thought of maybe the most inconvenient way to handle this!
It would be a button + textbox combination, let's say we name the textbox "txtBox" and the button "btn1"
You could then go to the button's Click event and set it to this:

Code:
Private Sub btn1_Click()
txtBox.Value = Int((100 - 1 + 1) * Rnd + 1)
End Sub

Which results in the most frustrating user experience i can imagine!

Sorry, i was bored!
 
o wow thank you Guys!!!

i will go with the loop

Jacek
 

Users who are viewing this thread

Back
Top Bottom