Access VBA random value from combobox -


i have combobox of client codes links table - clientt.

when click button randomcmd random client code appear in combobox.

my thought use vba code find maximum number of clients in clientt, rnd function pick number between max , 0, convert number value list.

i can't find similar code use. have far number generates randomly.

private sub randomcmd_click()     clientcodecmb = int(999 * rnd) + 1 end sub 

please help.

if customer id first column of combobox , bound column, do:

private sub randomcmd_click()      dim maxcustomerid = 1000 ' adjust needed.      me!clientcodecmb.value = int((maxcustomerid + 1) * rnd  end sub 

Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -