Name Sorting...

M

MollyS

I'm making a floor duty schedule for my company where I have set times and
dates but I need the names sort in no order...just random sorting. Can
anyone help me?
 
K

KARL DEWEY

I need the names sort in no order...just random sorting.
One way would be to add a calculated field for sorting like this --
SortField: Right(Left([Name],3),2)
 
M

MollyS

Karl I think you are on the right track as to what I'm wanting...but I'm
exactly understanding the formula. Would you mind further explaining it?

KARL DEWEY said:
One way would be to add a calculated field for sorting like this --
SortField: Right(Left([Name],3),2)

--
KARL DEWEY
Build a little - Test a little


MollyS said:
I'm making a floor duty schedule for my company where I have set times and
dates but I need the names sort in no order...just random sorting. Can
anyone help me?
 
K

KARL DEWEY

What I posted was a calculated field that takes the 2nd and 3rd letter of the
name for sorting. Just add the field in the query design view or in the
report Sorting and Grouping.

If you need additional randomness then expand it like this --
SortField: Right(Left([Name],3),2) & Right([Name],2) & Left([Name],2)

--
KARL DEWEY
Build a little - Test a little


MollyS said:
Karl I think you are on the right track as to what I'm wanting...but I'm
exactly understanding the formula. Would you mind further explaining it?

KARL DEWEY said:
I need the names sort in no order...just random sorting.
One way would be to add a calculated field for sorting like this --
SortField: Right(Left([Name],3),2)

--
KARL DEWEY
Build a little - Test a little


MollyS said:
I'm making a floor duty schedule for my company where I have set times and
dates but I need the names sort in no order...just random sorting. Can
anyone help me?
 
J

John W. Vinson

I'm making a floor duty schedule for my company where I have set times and
dates but I need the names sort in no order...just random sorting. Can
anyone help me?

You can do this wit some help from a little VBA. Put this function into a
Module:

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

Then add a calculated field to your Query by typing

Shuffle: RndNum([fieldname])

in a vacant Field cell, where [fieldname] is any field in
your table - this forces Access to give a different random
number for each record.

Sort the query by Shuffle.
 
Top