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
Post a Comment