Solved Creating combobox rowsource in quiry builder - sequantial number (1 Viewer)

jaryszek

Registered User.
Local time
Today, 03:41
Joined
Aug 25, 2016
Messages
662
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
 

mamradzelvy

Member
Local time
Today, 12:41
Joined
Apr 14, 2020
Messages
145
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.
 

moke123

AWF VIP
Local time
Today, 06:41
Joined
Jan 11, 2013
Messages
1,586
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
 

arnelgp

error reading drive A:
Local time
Today, 18:41
Joined
May 7, 2009
Messages
9,872
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
 

mamradzelvy

Member
Local time
Today, 12:41
Joined
Apr 14, 2020
Messages
145
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:

mamradzelvy

Member
Local time
Today, 12:41
Joined
Apr 14, 2020
Messages
145
(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!
 

jaryszek

Registered User.
Local time
Today, 03:41
Joined
Aug 25, 2016
Messages
662
o wow thank you Guys!!!

i will go with the loop

Jacek
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom