17. Design a data entry screen in VB for the following case: A company wants to find out the response of people to their new product which was Introduce in the market. a. Accept the name of the customer. b. Provide choice as Excellent, Satisfactory, Average, Bad. c. Should provide Continue & Quit button. When user click on Continue the previous data should be erased and new data should be accepted. The Quit button should display a report showing the total number of customers who entered their opinion and the percentage of customer who feels that the product is Excellent, Satisfactory, Average Or Bad. NOTE: The user can choose only opinions provided.


Dim Excellent As Integer
Dim Satisfactory As Integer
Dim Average As Integer
Dim Bad As Integer
Dim Total As Integer

Private Sub cmdContinue_Click()
If optExcellent.Value Then
Excellent = Excellent + 1
ElseIf optSatisfactory.Value Then
Satisfactory = Satisfactory + 1
ElseIf optAverage.Value Then
Average = Average + 1
Else
Bad = Bad + 1
End If
txtName.Text = “”
optExcellent.Value = False
optSatisfactory.Value = False
optAverage.Value = False
optBad.Value = False
txtName.SetFocus
End Sub

Private Sub cmdQuit_Click()
Total = Excellent + Satisfactory + Average + Bad
With frmServeyResult
.lblExcellent = Excellent
.lblSatisfactory = Satisfactory
.lblAverage = Average
.lblBad = Bad
.lblExcellentPer = Format((Excellent / Total) * 100, “#0.00”)
.lblSatisfactoryPer = Format((Satisfactory / Total) * 100, “#0.00”)
.lblAveragePer = Format((Average / Total) * 100, “#0.00”)
.lblBadPer = Format((Bad / Total) * 100, “#0.00”)
End With
frmServeyResult.Show
Unload Me
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s