Output not coming out right

jimmypop

Member
Joined
Feb 18, 2005
Messages
7
Programming Experience
Beginner
I'm trying to get something to show up on an output box and I cannot get it to show up right.

Here is an example of how it is supposed to look
Quote :"Smith is an ISM major, and is currently enrolled in ISM 240.
The majority of time is spent in the Bryan building.
Expected graduate time is May 2005
"

What I've done is made a function for the MAJOR, CLASS, BUILDING, GRAD DATE. I have each function set up as an IF statement.

for example

Quote :" Function Majors(ByVal Major As Double) As Double

If rdoACC.Checked Then
Major = "ACC"
Else
If rdoECO.Checked Then
Major = "ECO"

Else
If rdoISM.Checked Then
Major = "ISM"
Else
If rdoFIN.Checked Then
Major = "FIN"
Else
MsgBox("PICK A MAJOR")
End If
End If
End If
End If

End Function"

and here is the bit of code I have for the button click event for my list box.

Quote :"lstDisplay.Items.Add(txtName.Text & " is a " & Majors() & "and is currently enrolled in " & Subjects())"

I'm getting an error message that says
Quote :"C:\Documents and Settings\Desktop\Project 6\WindowsApplication1\Form1.vb(317): Argument not specified for parameter 'Major' of 'Public Function Majors(Major As Double) As Double'.
"

If it's something easy or fix great, but if it looks like it's a pain in the ass and I should start over let me know along with a hint or two about what not to do wrong.

Thanks
jimmypop
 
For your function you've specified a parameter (major) :

Function Majors(ByVal Major As Double)


Then when you call the function you haven't included it:

:"lstDisplay.Items.Add(txtName.Text & " is a " & Majors() & "and is currently enrolled in " & Subjects())"

You could either take the parameter out, make it optional or pass a value.

TPM
 
Back
Top