I am new to this and the book doesn't explain how to enter data from the user's input box into a listbox, the information is then to be calculated when you get all five grades into the listbox. For some reason I can't get the info to go into the listbox. Can anyone help me?
entering data into a listbox?
Collapse
X
-
Hi there arizona, are you going to be adding these things in code? does you form have just a listbox and a button? because if it has these things you might want to try this:
example:
Code:Private Sub Command1_Click() Dim command1 As String command1 = inputbox("AddItem") List1.AddItem "What ever you want to add" List1.AddItem "What ever you want to add" 'and so on End Sub
-
You are using inputbox or textbox for user input ?
If using inputbox then try this sample code
[code=vb]private sub command1_click( )
dim s1 as string,s2 as string, s3 as sting
list1.clear
s1=inputbox("en ter grade1")
list1.additem s1
s2=inputbox("en ter grade2")
list1.additem s2
s3=inputbox("en ter grade3")
list1.additem s3
end sub[/code]Comment
Comment