Hi,
In MS Access 2010 I have a Table with multiple columns:
For columns 2 to 5, the values are only 0(zer0) and 1. If 1, it means the user has such device.
I need a 6th column that will tell me which devices a user has. For example if user Juan Smith uses (iPhone and iPad and Android_Tablet) the 6th column would say
1. Juan Smith
6. iPhone+iPad+Android_Tablet
With that format, then I can use columns 1 and 6 to make pivot tables and graphs.
I am able to do this in Excel using loops and arrays. Excel is not an option anymore, since I have a vast amount of data, Excel takes hours versus Access takes seconds.
Here is a sample of my VBA script in Excel.
In MS Access 2010 I have a Table with multiple columns:
- User
- iPhone
- IPad
- Android_Tablet
- Android_Smartphone
For columns 2 to 5, the values are only 0(zer0) and 1. If 1, it means the user has such device.
I need a 6th column that will tell me which devices a user has. For example if user Juan Smith uses (iPhone and iPad and Android_Tablet) the 6th column would say
1. Juan Smith
6. iPhone+iPad+Android_Tablet
With that format, then I can use columns 1 and 6 to make pivot tables and graphs.
I am able to do this in Excel using loops and arrays. Excel is not an option anymore, since I have a vast amount of data, Excel takes hours versus Access takes seconds.
Here is a sample of my VBA script in Excel.
Code:
'The firt loop travels vertically...top to bottomFor arrRow = 2 To UBound(arrCombos) '- 1
'this array travels horizontally, left to right
For arrColumn = 3 To 8
If arrCombos(arrRow, arrColumn) = 1 Then
If nmCombo = "" Then
nmCombo = arrCombos(1, arrColumn)
Else
nmCombo = nmCombo & "+" & arrCombos(1, arrColumn)
End If
arrCombos(arrRow, 9) = nmCombo
Else
End If
Next
If nmCombo = "" Then arrCombos(arrRow, 9) = "NO users"
nmCombo = ""
Next