Is there any way to write an update query with random values. For example I want to update records and make a certain field equal to ??1?8?5? with ?= a random value. Is this possible?
I did not say by hand
if you use rnd you will need to keep resetting the number by calling it so something like this
set rst= recordset
dim rnd1 as integer
dim rnd2 as integer
dim rnd3 as integer
dim rnd4 as integer
dim rnd5 as integer
set rst=currentdb.openrecordset("youtablename")
do until rst.eof
set rnd1 = Int((9 * Rnd) + 1)
set rnd2 = Int((9 * Rnd) + 1)
set rnd3 = Int((9 * Rnd) + 1)
set rnd4 = Int((9 * Rnd) + 1)
set rnd5 = Int((9 * Rnd) + 1)
'??1?8?5? with ?=
rst!filename = rnd1 & rnd2 & "1" & rnd3 & "8" rnd4 & "5" & rnd5
rst.movenext
loop
rst.close
set rst= nothing
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.