Hey group

,
I am not exactly new to DB or DBPro (I own both), but there is one thing that has been stumping me for about a week now. I can't seem to figure out aformula that will figure out all possible combinations that can be created using a set of numbers. For example:
The numbers: 12345
I want to be able to find all combinations and save them in an array (such as 12354, 12534, 15234, 51234, etc...) without having to manually enter all the possible combinations! Can anyone provide example code that would do such a thing? It seems like it wouldn't be hard to come up with something that works (and doesn't duplicate combinations) but I'm stuck. Thanks in advance!