Computing.Net > Forums > Programming > visual basic question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

visual basic question

Reply to Message Icon

Name: donever
Date: February 7, 2009 at 23:14:39 Pacific
OS: Windows xp
CPU/Ram: athlon 3g
Product: Custom / CUSTOM BUILD
Subcategory: General
Comment:

Hello! ok so I'm doing this project and it require the if then elseif. my question is assume that I have two groupbox. user must select one of the radio button from each groupbox. One of the groupbox is type of car and the other is gas option.

so the user choose a honda from type of car and prepay from gas option. once selected, this command will happen.

decTotalCostOfRent = honda rend price + prepay price

I guess my question is how do I tackle this problem.

this is what I have so far and it work but
unfortunately I have three type of car and it won't work.please help.


If Me.radJeepWrangler.Checked And radPrepay.Checked Then
decCostPerDay = decJeepWrangler + decPrePay

ElseIf radJeepWrangler.Checked And radSelfPaying.Checked Then
decCostPerDay = decJeepWrangler + decSelfPay
End If



Sponsored Link
Ads by Google

Response Number 1
Name: aurora
Date: February 8, 2009 at 15:14:26 Pacific
Reply:

Let me get this straight, it works for one type of car but not for the others? I might be able to help you considering I'm currently doing the exact same project for my class. also would it be possible to post some more information? like what will these fomulas be calculating?


0

Response Number 2
Name: donever
Date: February 8, 2009 at 16:29:49 Pacific
Reply:

ok i figure it out! here is the code to get you started if you have some difficult doing the homework yourself.

If IsNumeric(Me.txtNumberOfDayRent.Text) Then decNumberOfDayRend = Convert.ToDecimal(Me.txtNumberOfDayRent.Text)

If decNumberOfDayRend > 0 And decNumberOfDayRend < 8 Then

If Me.radJeepWrangler.Checked And radPrepay.Checked And radMultipleDriver.Checked Then
decCostPerDay = decJeepWrangler + decPrePay + decMultipleDriver
ElseIf radJeepWrangler.Checked And radSelfPaying.Checked And radMultipleDriver.Checked Then
decCostPerDay = decJeepWrangler + decSelfPay + decMultipleDriver
ElseIf radJeepWrangler.Checked And radSelfPaying.Checked Then
decCostPerDay = decJeepWrangler + decSelfPay
ElseIf radJeepWrangler.Checked And radPrepay.Checked Then
decCostPerDay = decJeepWrangler + decPrePay


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Real VNC (Unlock Remote P... Set PID in Tasklist as Va...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: visual basic question

Visual Basic Question www.computing.net/answers/programming/visual-basic-question/17451.html

Newbie Visual Basic Question www.computing.net/answers/programming/newbie-visual-basic-question/9649.html

please help visual basic www.computing.net/answers/programming/please-help-visual-basic/3769.html