Solved

Visual Basic Assignment. Need help!

Posted on 2013-11-22
6
754 Views
Last Modified: 2013-11-22
Instruction : Woody Real Estate HW5
Outcome : Must be same with HW5 0101-Hellow_World
Visual Basic File : HW5-0101-Jong-Lee

Hi I totally get lost from #11 to #13 (Instruction)
Could you please write down codes for me?
I really need your help as soon as possible!

Thank you!

--From number 11

    Private Funtion SearchFrom(ByVal startIndex As integer,
                    Byval bedroom as Integer,
                    ByVal bathroom As Integer,
                    ByVal proptate As String) As Integer

    Private Sub searchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchButton.Click

    End Sub

    Private Sub searchNextButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchNextButton.Click

    End Sub
End Class
Woody-Real-Estate-HW5.docx
HW5-0201-Jong-Lee.vbproj
0
Comment
Question by:John_Lef
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 39668745
Try to do your own homework and come back with exact questions. If we do it all for you, you will never learn!
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 500 total points
ID: 39668819
The instructions are pretty good...what's the problem?

Did you add the function to your code?

Basically you just need to iterate over the arrays until you find a match, or return -1 if no match is found.

If you don't know how to write a For loop, look here or here.

Or you could just use this code instead:
    Private Function SearchFrom(ByVal startIndex As Integer, _
                    ByVal bedroom As Integer, _
                    ByVal bathroom As Integer, _
                    ByVal proptate As String) As Integer

        MessageBox.Show("You can't afford a House!")
        Return -1

    End Function

Open in new window

0
 

Author Comment

by:John_Lef
ID: 39668849
Can you please show me one example?
I know only basic For Loop, so i dont know how to apply it here
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 500 total points
ID: 39668878
I did give you an example, TWO of them in fact.  Follow the links..,

The first link just shows how to write a generic For loop.
The second link, in Example 2, actually has a For loop that accesses an Array called "rabbits".
0
 

Author Comment

by:John_Lef
ID: 39668953
Oh okay i got it!
I have a final question for #12

    Private Sub searchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchButton.Click
        Dim bedroomSearch As Integer = CInt(bedroomComboBox.SelectedItem)
        Dim bathroomSearch As Integer = CInt(bathroomComboBox.SelectedItem)
        Dim stateSearch As String = CStr(stateComboBox.SelectedItem)
        Dim searchResult As Integer

        searchResult = SearchFrom(0, bedroomSearch, bathroomSearch, stateSearch)

        If searchResult = -1 Then
            MessageBox.Show("Not found!")
        End If
    End Sub

Is there any other way to do #12? I wonder if there is easiler way to do this.
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 39669014
Doesn't get much simpler than that.

If -1 is NOT returned, though, then you should probably display the search result somewhere!  ;)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 14 hours left to enroll

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question