Name Sorting...

  • Thread starter Thread starter MollyS
  • Start date Start date
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?
 
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 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?
 
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?
 
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.
 

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.

Ask a Question

Similar Threads


Back
Top