| | |
Choice Selection help
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2007
Posts: 13
Reputation:
Solved Threads: 0
This is the program im trying to write:
http://farm3.static.flickr.com/2324/...0be6bf.jpg?v=0
I have this so far for coding, and its not working. I also get this error "Conversion from string "h" to type 'Boolean' is not valid"
Dim totalstandardhalfday As Double
Dim totalstandardardfullday As Double
Dim totaldeluxehalfday As Double
Dim totaldeluxefullday As Double
totalstandardhalfday = 30 + 32
totalstandardardfullday = 65 + 30
totaldeluxehalfday = 72 + 30
totaldeluxefullday = 144 + 30
If txtitem.Text = "1" & txtduration.Text = "h" Then
lstreceipt.Items.Add("Receipt from Victor's Room Rental")
lstreceipt.Items.Add(" ")
lstreceipt.Items.Add("Standard Rooming" & " $32.00" & " Half-day Rental")
lstreceipt.Items.Add("Deposit" & " $30.00")
lstreceipt.Items.Add("")
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totalstandardhalfday))
Else : txtitem.Text = "1" & txtduration.Text = "F"
lstreceipt.Items.Add("Receipt from Victor's Room Rental")
lstreceipt.Items.Add(" ")
lstreceipt.Items.Add("Deluxe Rooming" & " $65.00" & " Full-Day Rental")
lstreceipt.Items.Add("Deposit" & " $30.00")
lstreceipt.Items.Add("")
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totalstandardardfullday))
End If
If txtduration.Text = "2" & txtitem.Text = "H" Then
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totaldeluxehalfday))
Else : txtduration.Text = "2" & txtitem.Text = "F"
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totaldeluxefullday))
End If
Thanks In Advance.
http://farm3.static.flickr.com/2324/...0be6bf.jpg?v=0
I have this so far for coding, and its not working. I also get this error "Conversion from string "h" to type 'Boolean' is not valid"
Dim totalstandardhalfday As Double
Dim totalstandardardfullday As Double
Dim totaldeluxehalfday As Double
Dim totaldeluxefullday As Double
totalstandardhalfday = 30 + 32
totalstandardardfullday = 65 + 30
totaldeluxehalfday = 72 + 30
totaldeluxefullday = 144 + 30
If txtitem.Text = "1" & txtduration.Text = "h" Then
lstreceipt.Items.Add("Receipt from Victor's Room Rental")
lstreceipt.Items.Add(" ")
lstreceipt.Items.Add("Standard Rooming" & " $32.00" & " Half-day Rental")
lstreceipt.Items.Add("Deposit" & " $30.00")
lstreceipt.Items.Add("")
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totalstandardhalfday))
Else : txtitem.Text = "1" & txtduration.Text = "F"
lstreceipt.Items.Add("Receipt from Victor's Room Rental")
lstreceipt.Items.Add(" ")
lstreceipt.Items.Add("Deluxe Rooming" & " $65.00" & " Full-Day Rental")
lstreceipt.Items.Add("Deposit" & " $30.00")
lstreceipt.Items.Add("")
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totalstandardardfullday))
End If
If txtduration.Text = "2" & txtitem.Text = "H" Then
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totaldeluxehalfday))
Else : txtduration.Text = "2" & txtitem.Text = "F"
lstreceipt.Items.Add("Total:" & " " & FormatCurrency(totaldeluxefullday))
End If
Thanks In Advance.
Last edited by Magnusz; Nov 13th, 2007 at 1:09 pm.
In your If statment You need to use the word AND not &
VB.NET Syntax (Toggle Plain Text)
If txtitem.Text = "1" & txtduration.Text = "h" Then
VB.NET Syntax (Toggle Plain Text)
If txtitem.Text = "1" AND txtduration.Text = "h" Then
It is your Ifs Fires off the code for one of the Ifs and One Else
Try
VB.NET Syntax (Toggle Plain Text)
If * Then 'Do This Else 'Or Do This End If 'AND If *2 Then 'Do This Else 'Or Do This End If
Try
VB.NET Syntax (Toggle Plain Text)
If * Then 'Do This ElseIf *2 then 'Or Do This ElseIf *2 Then 'Or Do This Else 'Or Do This End If
![]() |
Similar Threads
- Selection Sort in java (Java)
- need help on simple turbo C program.. thx (C)
- need help for address book program in Turbo C not C++.. (C)
- Cleaning C: Drive (Windows NT / 2000 / XP)
- Some help needed with Selection Sort in java, Please!! (Java)
- Need some help with my do-while and while loops (Java)
Other Threads in the VB.NET Forum
- Previous Thread: Please How to insert
- Next Thread: Sending strings over IP
| Thread Tools | Search this Thread |
"crystal .net 2008 access add advanced application array assignment basic beginner box browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic dosconsolevb.net eclipse editvb.net employees excel exists firewall forms html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port print printpreview record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer transparency txttoxmlconverter upload useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winsock wpf wrapingcode xml





