I have a class assignment where i have to calculate the total cost of a parking garage from hours but i have to do it with a method function. So this might be a stupid question but can you read the user input values from a textbox in the function itself or do they have to be read in and recalled from the Private Sub Button1_Click section?
valkerye 0 Newbie Poster
Recommended Answers
Jump to PostYes you can read from a text file if the textbox is referenced. In your function you will have something like -
Private Function CalculateHours (txtReadFrom As Textbox) GetTheHours = txtReadFrom.Text 'And all other codes... End Function Private Sub Command1_Click CalculateHours Text1 'Text1 is the actual textbox …
Jump to PostHi,
You do not define the function or method with in your sub routine, it is available to all subroutines and functions with your form. Take line 10 out and it should work.Dim CalculateCharges As Decimal 'not needed as CalculateCharges is a function
You have specified …
All 8 Replies
valkerye 0 Newbie Poster
AndreRet 526 Senior Poster
vesh2009 0 Newbie Poster
G_Waddell 131 Posting Whiz in Training
G_Waddell 131 Posting Whiz in Training
vesh2008 0 Newbie Poster
G_Waddell commented: Asking to have project coded for them +0
G_Waddell 131 Posting Whiz in Training
valkerye 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.