On Tue, 08 May 2007 23:54:40 GMT, "Steve" <so***@private.emailaddress>
wrote:
There are several ways. Off the top of my head here is one using DAO:
public sub FillWithRandom
dim rs as dao.recordset
randomize
set rs=currentdb.openrecordset("myTable", dbOpenTable)
while not rs.eof
rs.Edit
rs!FieldA = GetRandom(1,11)
rs.Update
rs.MoveNext
wend
rs.close
end sub
private function GetRandom(byval intLow as integer,byval intHigh as
integer) as integer
GetRandom=Int((intHigh - intLow + 1) * Rnd + intLow)
end function
-Tom.
>How can I fill an empty field (FieldA) in a table with random integers
between 1 and 11?
Thanks!