You are here:

Visual Basic/Listbox Update And Printing Asterisks


Need a Visual Basic program. A list box containing five stores (all five stores set to a revenue of 0). The user should be able to update the revenue (and maintain therevenue) by typing the revenue in a textbox (and then clicking a button). The program also needs to print out asterisks (*), each asterisk represents 100(printed out as a chart). If there is 0-99 revenue, no asterisk is displayed. The selected index should also be displayed by clicking a store. Can you please help with the coding?

Dim adu As Integer, idu As String
Private Sub Command1_Click()
If Text1 = "" Or Val(Text1) = 0 Or Val(Text1) < 100 Then
MsgBox ("enter valid number")
Text1 = ""

Exit Sub
End If
List1.AddItem Aster(Val(Text1))
End Sub
Private Function Aster(olage As Integer)
adu = Fix((Text1) / 100)

For i = 1 To adu
Aster = Aster & " *"
End Function

this code is ok. make changes as you need

Visual Basic

All Answers

Answers by Expert:

Ask Experts




visual basic application programming from design to access information, sql, engineering and commercial applications. access databases, excel.(VB6) basic questions in vb 2008. Optional: 1)a large number of people want me to do work which takes some time and effort. can do projects in vb 2008. Pl.note that i would like to be paid for such work. 2) if you want me to spend quality time and do special work, i expect to be paid a reasonable price for my time. 3) if you are pleased with my reply you could consider a good amount. 4) you can visit my website


programming since the past 15 years. have completed a large number of projects in Industrial applications, finance,accounts, correspondence. excel macros etc

engineering, management degrees.

Past/Present Clients
project work for a Norway company,USA company and a Canadian company completed. Freelance Project work and Teaching. helping programmers with their work
teaching vb

©2017 All rights reserved.