JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: Does anyone know how to create a survey with numbers?
This isn't the answer, but is just to give you an idea (i.e. modifications or using it as a template could give you the answer).
Based on the picture, it has to allow for multiple users, not just one -- I wouldn't do it like this normally.
Option Explicit
Private Sub Form_Load()
Const ALWAYS = 0
Const USUALLY = 1
Const SOMETIMES = 2
Const SELDOM = 3
Const NEVER = 4
Dim i As Integer
Dim i2 As Integer
Dim sTmp As String
Dim TotalsChart()
ReDim TotalsChart(1, NEVER)
' TotalsChart(USER, ANSWER) = Question_Numbers
'ex:
' First User
TotalsChart(0, ALWAYS) = "1,4,2,10"
TotalsChart(0, USUALLY) = "5"
TotalsChart(0, SOMETIMES) = "3, 9"
TotalsChart(0, SELDOM) = "6, 8"
TotalsChart(0, NEVER) = "7"
' Second User
TotalsChart(1, ALWAYS) = "3, 5, 7"
TotalsChart(1, USUALLY) = "4"
TotalsChart(1, SOMETIMES) = "2, 10"
TotalsChart(1, SELDOM) = "1, 8"
TotalsChart(1, NEVER) = "6, 9"
' Totals
' ALWAYS
For i = 0 To UBound(TotalsChart())
sTmp = "User " & i & vbCrLf
For i2 = ALWAYS To NEVER
TotalsChart(i, i2) = ItemCount(TotalsChart(i, i2))
sTmp = sTmp & vbTab & "Aswer " & i2 & ": " & TotalsChart(i, i2) & vbCrLf
Next
Debug.Print sTmp
Next
End Sub
Function ItemCount(ByVal Value As String) As Integer
Dim tmp() As String
tmp = Split(Value, ",")
ItemCount = UBound(tmp) + 1
End Function
|
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|