Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Have an error... need help

Okay, I'm sure I've got to be missing something, but I don't know what.

Here's the error:
BC30455: Argument not specified for parameter 'billingAddress' of 'Public Function funcConfInsert(I cut all this out for sanity sake in this post) As Object'.

And here's the situation:

I'm posting info to a database and the code was in a function. I am using a button to confirm the information before it's submitted and then a sub eventhandler to call the function. The error is thrown on the line that calls the function, but it references a parameter in the function itself. I already asked someone else who told me that I might be missing an argument on the line that calls the function, but I don't know what. I am still new to asp.net and might just be overlooking it, but I need some help identifying it.

Here's the Sub that calls the function:

Public Sub ConfInsert (ByVal sender As Object, ByVal e As System.EventArgs) handles Confbtn.Click
dim conf as string
conf = funcConfInsert
End Sub

And here's the beginning half of the function (it's much too long to post it all):

Public Function funcConfInsert( _
ByVal cardAmount As String, _
ByVal deliveryMethod As String, _
ByVal recipientName As String, _
ByVal recipientAddress As String, _
ByVal recipientCity As String, _
ByVal recipientState As String, _
ByVal recipientZip As String, _
ByVal recipientPhone As String, _
ByVal recipientEmail As String, _
ByVal senderName As String, _
ByVal billingName As String, _
ByVal billingAddress As String, _
ByVal billingCity As String, _
ByVal billingState As String, _
ByVal billingZip As String, _
ByVal billingPhone As String, _
ByVal billingEmail As String, _
)

What is it that I am doing wrong here?
John
[2276 byte] By [johnwooton] at [2007-11-11 8:17:55]
# 1 Re: Have an error... need help
Your not passing anything into the function.

conf = funcConfInsert

Your missing all of those input parameters...
edburdo at 2007-11-11 21:47:44 >
# 2 Re: Have an error... need help
I am not sure I understand. Can you elaborate. I have a set of labels that I have posted back that makeup the input values.
johnwooton at 2007-11-11 21:48:47 >
# 3 Re: Have an error... need help
John,

you can't call that function like this:

conf = funcConfInsert

If you want to call it like that you should have your function defined without parameters:

Public Function funcConfInsert( )

If you want to call your function you have to pass parameters, example:

conf = funcConfInsert(strAmount, strDelivery,...)

Another remark: there is a , too much in your function declaration:

Public Function funcConfInsert( _
ByVal cardAmount As String, _
ByVal deliveryMethod As String, _
ByVal recipientName As String, _
ByVal recipientAddress As String, _
ByVal recipientCity As String, _
ByVal recipientState As String, _
ByVal recipientZip As String, _
ByVal recipientPhone As String, _
ByVal recipientEmail As String, _
ByVal senderName As String, _
ByVal billingName As String, _
ByVal billingAddress As String, _
ByVal billingCity As String, _
ByVal billingState As String, _
ByVal billingZip As String, _
ByVal billingPhone As String, _
ByVal billingEmail As String, _
)

Hope this explains it a little.
Benjamin at 2007-11-11 21:49:46 >