I havent forgetten you, im stranded in Europe due to the volcano...
I have been reading about records and arrays during my vacation - yes I know lucky me (NOT) and believe for my final task I need to:
- define a type that consists of mixed data types so Name would be string and Mark would be Integer (infact it could be byte)
- after creating the type, call it in the program so that when the ADD button is clicked the name is stored in the name list box and the mark in the mark list box...
So far I have this but it doesnt work and Im not sure why, perhaps you can guys can help?
thanks in advance - will check back shortly, depending on internet connection availabilty...Code:Option Explicit '~~~ Creating the type Private Type Student strName As String intMark As Integer End Type Private Sub Form_Load() '~~~ Checking. This should be done first ! If Val(txtStudentMark.Text) <= 0 Then MsgBox "student mark cannot be less than zero. Please re-enter it" Exit Sub ElseIf Val(txtStudentMark.Text) > 100 Then MsgBox "student mark cannot be greater than 100. Please re-enter it" Exit Sub End If Element = Element + 1 ReDim Preserve strName(1 To Element) ReDim Preserve intMark(1 To Element) strname(student) = txtStudentName.Text intMark(student) = txtStudentMark.Text lstNames.AddItem txtStudentName.Text lstMarks.AddItem txtStudentMark.Text End Sub
thank you so much




Reply With Quote