473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to fix this parameter?

My Code

Expand|Select|Wrap|Line Numbers
  1. Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click
  2.         Dim oldBalance, charges, credits As Double
  3.         InputData(oldBalance, charges, credits)
  4.         DisplayData(NewBalance(oldBalance, charges, credits), MinPayment(NewBalance(oldBalance, charges, credits)))
  5.  
  6.     End Sub
  7.     Sub InputData(ByRef oldBalance As Double, ByRef charges As Double, ByRef credits As Double)
  8.         oldBalance = CDbl(txtoldBalance.Text)
  9.         charges = CDbl(txtcharges.Text)
  10.         credits = CDbl(txtcredits.Text)
  11.  
  12.     End Sub
  13.     Function NewBalance(ByVal oldBalance As Double, ByVal charges As Double, ByVal credits As Double)
  14.         NewBalance = oldBalance + charges - credits + (oldBalance * 0.015)
  15.  
  16.  
  17.     End Function
  18.     Function MinPayment(ByVal NewBalance As Double, ByVal oldBalance As Double, ByVal charges As Double, ByVal credits As Double) As Double
  19.         If NewBalance <= 20 Then
  20.             Return NewBalance
  21.         Else
  22.             Return 20 + (NewBalance - 20 * 0.1)
  23.  
  24.         End If
  25.  
  26.     End Function
  27.  
  28.     Sub DisplayData(ByVal NewBalance As Double, ByVal MinPayment As Double)
  29.         txtNewBalance.Text = FormatCurrency(NewBalance)
  30.         txtMinPayment.Text = FormatCurrency(MinPayment)
  31.  
  32.  
  33.     End Sub
  34.  
  35.     Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
  36.         Me.Close()
  37.  
  38.     End Sub
  39. End Class
blue lines under this
Expand|Select|Wrap|Line Numbers
  1. code-MinPayment(NewBalance(oldBalance, charges, credits)))
  2.  
error 1- argument not specified for parameter 'charges' Public Function(NewBalance As Double,oldBalance As Double, charges As Double, credits As Double) As Double

error 2-argument not specified for parameter 'credits' Public Function(NewBalance As Double,oldBalance As Double, charges As Double, credits As Double) As Double

error 3-argument not specified for parameter 'oldBalance' Public Function(NewBalance As Double,oldBalance As Double, charges As Double, credits As Double) As Double
Nov 10 '10 #1
1 1368
It looks like you havn't filled out your args all the way,
this is what you have;
Expand|Select|Wrap|Line Numbers
  1. DisplayData(NewBalance(oldBalance, charges, credits), _ 
  2. MinPayment(NewBalance(oldBalance, charges, credits)))
  3.  
this is what it should be;
Expand|Select|Wrap|Line Numbers
  1. DisplayData(NewBalance(oldBalance, charges, credits), _ 
  2. MinPayment(NewBalance(oldBalance, charges, credits),oldBalance,charges,credits))
  3.  
notice the extra ,oldBalance,charges,credits they fullfill the other minPayment args.

Hope this helps,
Nov 10 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
2
by: John A Grandy | last post by:
Is there something special in XML about the name "Parameter" ... I am not able to XPATH query for nodes named "Parameter" <Root> <Category CategoryID="1"> <Elements> <Element...
2
by: PK | last post by:
Hi, I have an application that opens a Crystal report document and passes in a value to a parameter in the report (pointing to an Oracle DB). However, if I want to pass a "null" value to retrieve...
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
4
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
3
by: Ken Cox [Microsoft MVP] | last post by:
I've been going around and around on this one. I can't believe that it is "by design" as Microsoft says. Here's the situation: In *declarative* syntax, I'm trying to create a default datetime...
20
by: exipnakias | last post by:
Hello Guys. In a form I created a listbox which looks up the values of a table. I want: 1) ..to create a query where a parameter will be needed in order to be loaded. But I do not want to...
5
by: Trevisc | last post by:
Happy Thursday Everyone, I am trying to create a parameter that is one long varchar but that will be used in a SQL statement IN function: //string queryString = GetCurrentTitles(); //Below is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.