|
Survey and polling tools are
often used in marketing or politics to assess
rating for certain services or
products. Polling tools can take many forms, some just use a
simple dichotomous scale of Yes and No, or Likert Scale that
consists of three or more choices. You can create Polling
tool in Visual Basic easily by using the option buttons. In
my program, I give the users five choices, Excellent, Very
Good, Good, Satisfactory and Bad.
Then the results are presented
in frequency and percentage respectively.
The program is shown on the
right.
|
Private Sub cmd_Vote_Click()
If Option_Excel.Value = True Then
Excel_total = Excel_total + 1
Lbl_ExcelTotal = Excel_total
ElseIf Option_VG.Value = True Then
VG_total = VG_total + 1
Lbl_VGTotal = VG_total
ElseIf Option_G.Value = True Then
G_total = G_total + 1
Lbl_GTotal = G_total
ElseIf Option_Sat.Value = True Then
Sat_total = Sat_total + 1
Lbl_SatTotal = Sat_total
ElseIf Option_Bad.Value = True Then
Bad_total = Bad_total + 1
Lbl_BadTotal = Bad_total
End If
total = Excel_total + VG_total + G_total + Sat_total +
Bad_total
Lbl_Total = total
Excel_percent = Excel_total / total
VG_percent = VG_total / total
G_percent = G_total / total
Sat_percent = Sat_total / total
Bad_percent = Bad_total / total
Lbl_Excel.Caption = Format(Excel_percent, "Percent")
Lbl_VG.Caption = Format(VG_percent, "Percent")
Lbl_G.Caption = Format(G_percent, "Percent")
Lbl_Sat.Caption = Format(Sat_percent, "Percent")
Lbl_Bad.Caption = Format(Bad_percent, "Percent")
End Sub
|