Recursion problem for all

  • Thread starter Savvoulidis Iordanis
  • Start date
S

Savvoulidis Iordanis

I' m on an app about football bets, and I want to analyze all the
possible combinations of the player's input as if they where
made separately. I explain below:

Let's say we have 4 matches to bet on, A,B,C and D, with the
following expected results (bets) filled by the player in
an 4 x 2 array (or better a M x N array):
{ {"1" , ""} , {"X" , "2"} , {"1" , "2"} , {"X" , ""} }

A. 1
B. X or 2
C. 1 or 2
D. X

After the analysis, the above should spread as 4 possible columns :
A. 1 1 1 1
B. X 2 X 2
C. 1 1 2 2
D. X X X X

Using recursion, how can I create all the possible combinations as a (~)
separated string ?
Of course if there is any solution without recursion, it' s welcome


PS. Smart code is expected (with a few comments on what it does)...

TIA
 
M

Michel Walsh

Hi,


No need of recursion.

Have four tables, one field each, as many records as there is possibility
(one record for tableA, 2 for tableB, etc)

In a query, bring all the four table, and, in the grid, drag their field. DO
NOT have any join between the tables (in the upper part of the designer).


Each row of the result will give a "combination" (the "transposed" of what
you pictured, since we are limited to 255 fields, but there is no limit in
the number of record, the transposed representation is more appropriate).




Hoping it may help,
Vanderghast, Access MVP
 
Top