Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function
This query is then run:
SELECT Table1.Num, Rnd([Num]) AS RndNo
FROM Table1;
But every time I open a new session the same random numbers appera for each
Num.
Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function
This query is then run:
SELECT Table1.Num, Rnd([Num]) AS RndNo
FROM Table1;
But every time I open a new session the same random numbers appera for each
Num.
Or maybe you meant to call it in the query and just typed
Rnd instead??
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.