I am trying to randomly select a client on a form. The query behind the form
is as follows:
SELECT TOP 1 Rnd([ClientID]) AS Shuffle, tblClients.ClientID, tblClients.
Client
FROM tblClients
ORDER BY Rnd([ClientID]);
However, whenever the form is first opened it always diplays the same record,
when open a second time it always displays the same second record, etc. i.e.
it seems to always 'randomly' select the same ones in the same order???
I have put a requery command in the OnOpen event of the form. What have I
missed?
Thanks in advance?

Signature
Darren
Allen Browne - 31 Jul 2006 14:46 GMT
Replace the Requery in Form_Open with:
Randomize

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I am trying to randomly select a client on a form. The query behind the
>form
[quoted text clipped - 13 lines]
> I have put a requery command in the OnOpen event of the form. What have I
> missed?
darren - 31 Jul 2006 16:45 GMT
Thanks Allen.
It didn't solve it, but it did point me in the right direction.I took the Rnd
out of the query and into a function it seemed Randomize in the form did not
seem to reset the seed for the query.
Public Function fnRndNum(vIgnore As Variant) As Double
Randomize
fnRndNum = Rnd()
End Function
I then used this function in the same query and it worked.
Many Thanks

Signature
Darren