How do i go about this code, I want to call amountpayable on the confirm purchase button but it says amount payable is not declared and I am having a hard time trying to pass the value from another function... Anyone knows a quick easy fix? I am not familiar with visual basic so if someone can share a light on this query I just want an easy one, one i can easily understand
Here is the code
Private Sub BtnAddOrder_Click(sender As Object, e As EventArgs) Handles BtnAddOrder.Click
Dim AddOns As String
Dim BlackPearl As String
Dim Oreo As String
Dim Nata As String
Dim CoffeeJelly As String
Dim CreamCheese As String
AddOns = " "
BlackPearl = " "
Oreo = " "
Nata = " "
CoffeeJelly = " "
CreamCheese = " "
If ChkBoxBlackPearl.Checked = True Then
AddOns = "Black Pearl"
End If
If ChkBoxOreo.Checked = True Then
AddOns = AddOns & "," & " Oreo"
End If
If ChkBoxNata.Checked = True Then
AddOns = AddOns & "," & " Nata De Coco"
End If
If ChkBoxCoffeeJelly.Checked = True Then
AddOns = AddOns & "," & " Coffee Jelly"
End If
If ChkboxCreamCheese.Checked = True Then
AddOns = AddOns & "," & " CreamCheese"
End If
Dim Payment As String
Payment = " "
If RbtnGcash.Checked = True Then
Payment = "Gcash"
End If
If RbtnDebit.Checked = True Then
Payment = "Debit Card"
End If
If RbtnCoins.Checked = True Then
Payment = "Coins.ph"
End If
If RbtnCash.Checked = True Then
Payment = "Cash"
End If
Dim DiscountRate As Double
If RbtnPWD.Checked = True Then
DiscountRate = 0.05
End If
If RbtnSenior.Checked = True Then
DiscountRate = 0.1
End If
If RbtnStudent.Checked = True Then
DiscountRate = 0.03
End If
If RbtnDiscountNone.Checked = True Then
DiscountRate = 0
End If
Dim Transaction As String
Transaction = " "
If RbtnDelivery.Checked = True Then
Transaction = "15"
End If
If RbtnWalkin.Checked = True Then
Transaction = "None"
End If
TxtTotalAddOn.Text = Val(TxtBlackPearl.Text) + Val(TxtOreo.Text) + Val(TxtNataDeCoco.Text) + Val(TxtCoffeeJelly.Text) + Val(TxtCreamCheese.Text)
Dim Total As Integer
Dim DiscountPrice As Double
Dim AmountPayable As Double
Total = Val(TxtTotalAddOn.Text) + Val(TxtSizeprice.Text) + Val(TxtDeliveryFee.Text)
DiscountPrice = Total * DiscountRate
AmountPayable = (Total - DiscountPrice) * Val(ComboQuantity.Text)
If AddOns.Length <> 0 Then
MessageBox.Show("********************************" + vbCr + "Troo Tea Ordering System" + vbCr + "********************************" + vbCr + "Choosen DRINK: " + ComboDrink.Text + vbCr + "********************************" + vbCr + "Quantity: " + ComboQuantity.Text + vbCr + "********************************" + vbCr + "Size: " + Sizename + vbCr + "********************************" + vbCr + "Price " + TxtSizeprice.Text + vbCr + "********************************" + vbCr + "AddOns: " + AddOns + vbCr + "********************************" + vbCr + "Total AddOns " + TxtTotalAddOn.Text + vbCr + "********************************" + vbCr + "Delivery Fee" + TxtDeliveryFee.Text + vbCr + "********************************" + vbCr + "Discount " + TxtDiscount.Text + vbCr + "Total " + Total.ToString + vbCr + "Amount Payable: " + AmountPayable.ToString + vbCr + "********************************" + vbCr + "*******************" + vbCrLf + "Thank You For Your Order" + vbCrLf + "*******************")
End If
TxtOrderDetails.Text = ("Customer Name: " + TxtCustomername.Text + vbCrLf + "Phone Number: " + TxtPhone.Text + vbCrLf + "Address: " + TxtAddress.Text + vbCrLf + "***********************************************************" + vbCrLf + "Choosen DRINK: " + ComboDrink.Text + vbCrLf + "Quantity: " + ComboQuantity.Text + vbCrLf + "Size: " + Sizename + vbCrLf + "Price: " + TxtSizeprice.Text + vbCrLf + "AddOns: " + AddOns + vbCrLf + "Total AddOns: " + TxtTotalAddOn.Text + vbCrLf + "Delivery Fee: " + TxtDeliveryFee.Text + vbCrLf + "Mode Of Payment: " + Payment + vbCrLf + "Discount Rate for Each Order: " + TxtDiscount.Text + vbCrLf + "Total Price Per Order: " + Total.ToString + vbCrLf + "Amount Payable: " + AmountPayable.ToString + vbCrLf + "***********************************************************" + vbCrLf + "Thank You For Your Order" + vbCrLf + "***********************************************************" + vbCrLf + "Date Of Transaction: " + DateTimePicker1.Text)
End Sub
Private Sub BtnConfirm_Click(sender As Object, e As EventArgs) Handles BtnConfirm.Click
End Sub
End Class
Since you can't modify the signature of an event handler, you won't be able to pass the variable from one handler to the other. Instead, declare the variable as a field within the class.
See additional comments added in the code below. I simply cut out some of the code you provided for brevity and shifted the declaration of the AmountPayable to outside of the sub it was originally declared in.
You can read more on variable scope here
Private AmountPayable As Double 'move this declaration outside of the sub
Private Sub BtnAddOrder_Click(sender As Object, e As EventArgs) Handles BtnAddOrder.Click
Dim Total As Integer
Dim DiscountPrice As Double
Total = Val(TxtTotalAddOn.Text) + Val(TxtSizeprice.Text) + Val(TxtDeliveryFee.Text)
DiscountPrice = Total * DiscountRate
'variable can be assigned here
AmountPayable = (Total - DiscountPrice) * Val(ComboQuantity.Text)
End Sub
Private Sub BtnConfirm_Click(sender As Object, e As EventArgs) Handles BtnConfirm.Click
MessageBox.Show("Your Total is $" & AmountPayable) 'variable can be accessed here
End Sub
End Class
Related
I am trying to loop these textboxes to accept multiple orders in one form in vb.net. I have trouble looping these user input textboxes. I want that the customer can be able to order another with just one customer info and translate it into the textbox TxtOrderDetails .. Any idea how to go about this code? what loop should I use. I have tried listbox but it doesnt automatically compute the amountpayable which is what i want also. I want that every order it automatically adds the amountpayable of another order...
Private Sub BtnAddOrder_Click(sender As Object, e As EventArgs) Handles BtnAddOrder.Click
'used to restrict empty inputs
If TxtCustomername.Text = "" Or TxtPhone.Text = "" Or TxtPhone.Text = "Invalid! Phone Number" Or TxtDiscount.Text = "" Or TxtDeliveryFee.Text = "" Or CboDrink.Text = "" Or CboQuantity.Text = "" Or TxtSizeprice.Text = "" Then
MessageBox.Show("Please Enter Required Fields!", "Authentication Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
Try
'if there are no unwanted inputs then the program proceeds to try other wise if there is an error
'the catch will handle it
Dim AddOns As String
Dim BlackPearl As String
Dim Oreo As String
Dim Nata As String
Dim CoffeeJelly As String
Dim CreamCheese As String
AddOns = " "
BlackPearl = " "
Oreo = " "
Nata = " "
CoffeeJelly = " "
CreamCheese = " "
'declaring the equivalent value of the add ons check boxes
If ChkBoxBlackPearl.Checked = True Then
AddOns = "Black Pearl"
End If
If ChkBoxOreo.Checked = True Then
AddOns = AddOns & "," & " Oreo"
End If
If ChkBoxNata.Checked = True Then
AddOns = AddOns & "," & " Nata De Coco"
End If
If ChkBoxCoffeeJelly.Checked = True Then
AddOns = AddOns & "," & " Coffee Jelly"
End If
If ChkboxCreamCheese.Checked = True Then
AddOns = AddOns & "," & " CreamCheese"
End If
'declaring the values of the payment radio buttons
Dim Payment As String
Payment = " "
If RbtnGcash.Checked = True Then
Payment = "Gcash"
End If
If RbtnDebit.Checked = True Then
Payment = "Debit Card"
End If
If RbtnCoins.Checked = True Then
Payment = "Coins.ph"
End If
'declaring the values of the discount radio buttons
If RbtnCash.Checked = True Then
Payment = "Cash"
End If
Dim DiscountRate As Double
If RbtnPWD.Checked = True Then
DiscountRate = 0.05
End If
If RbtnSenior.Checked = True Then
DiscountRate = 0.1
End If
If RbtnStudent.Checked = True Then
DiscountRate = 0.03
End If
If RbtnDiscountNone.Checked = True Then
DiscountRate = 0
End If
'declaring the values of the transaction radio buttons
Dim Transaction As String
Transaction = " "
If RbtnDelivery.Checked = True Then
Transaction = "15"
End If
If RbtnWalkin.Checked = True Then
Transaction = "None"
End If
'passing the values and converting them to numeric using val to show the total price of the add ons
TxtTotalAddOn.Text = Val(TxtBlackPearl.Text) + Val(TxtOreo.Text) + Val(TxtNataDeCoco.Text) + Val(TxtCoffeeJelly.Text) + Val(TxtCreamCheese.Text)
'declaring values to be computed for the total, cash and change of the customer
Dim TotalPreDelivery As Double
Dim FinalTotal As Double
Dim DiscountPrice As Double
Dim AmountPayable As Double
TotalPreDelivery = Val(TxtTotalAddOn.Text) + Val(TxtSizeprice.Text)
DiscountPrice = TotalPreDelivery * DiscountRate
FinalTotal = TotalPreDelivery - DiscountPrice
AmountPayable = (FinalTotal * Val(CboQuantity.Text)) + Val(TxtDeliveryFee.Text)
'condition to show result it via messagebox
If AddOns.Length <> 0 Then
MessageBox.Show("Choosen DRINK: " + CboDrink.Text + vbCr + "Quantity: " + CboQuantity.Text + vbCr + "Size: " + Sizename + vbCr + "Price " + TxtSizeprice.Text + vbCr + "AddOns: " + AddOns + vbCr + "Total AddOns " + TxtTotalAddOn.Text + vbCr + "Delivery Fee" + TxtDeliveryFee.Text + vbCr + "Discount " + TxtDiscount.Text)
End If
'process to show the results via textbox
TxtOrderDetails.Text = ("Customer Name: " + TxtCustomername.Text + vbCrLf + "Phone Number: " + TxtPhone.Text + vbCrLf + "Address: " + TxtAddress.Text + vbCrLf + "***********************************************************" + vbCrLf + "Choosen DRINK: " + CboDrink.Text + vbCrLf + "Quantity: " + CboQuantity.Text + vbCrLf + "Size: " + Sizename + vbCrLf + "Price: Php " + TxtSizeprice.Text + vbCrLf + "AddOns: " + vbCrLf + AddOns + vbCrLf + "Total Price of AddOns: Php " + TxtTotalAddOn.Text + vbCrLf + "Delivery Fee: Php " + TxtDeliveryFee.Text + vbCrLf + "Mode Of Payment: " + Payment + vbCrLf + "Total Price For Each MilkTea: Php " + FinalTotal.ToString + vbCrLf + "Discount Rate: " + TxtDiscount.Text + vbCrLf + "***********************************************************" + vbCrLf + " Thank You For Your Order" + vbCrLf + "***********************************************************" + vbCrLf + "Date Of Transaction: " + DateTimePicker1.Text)
TxtAmountPayable.Text = ("Php " + AmountPayable.ToString)
Use textbox.clear() to clear the textbox you want to enter repeatedly, such as product information.
Set a global variable to record AmountPayable, and then add a new price to AmountPayable with each button event.
Below is the code. What I'm confused about is how to get the BuyOne, BuyTwo, BuyThree, BuyFour array (arrBuyer) to allow blank entries. Right now if an entry is blank it'll say it's an invalid entry, whereas I just want it skipped over. In addition, if ALL entries are blank, I want it where the code just assumes the user wants to run every possible entry.
The user enters codes into four specific slots on the left of the page as seen in the image. Currently the code checks a list off to the right of the page to see if values match. How do I go about doing the above?
If Range("reqFrDt") = vbNullString Or IsDate(Range("reqFrDt")) = False Then
MsgBox "From date missing..."
Range("reqFrDt").Select
End
Else
sFrDt = Range("reqFrDt")
End If
If Range("reqToDt") = vbNullString Or IsDate(Range("reqToDt")) = False Then
MsgBox "To date missing or invalid.."
Range("reqToDt").Select
End
Else
sToDt = Range("reqToDt")
End If
lastRow = Range("O" & Rows.Count).End(xlUp).Row
Set rBuyerList = Range("O1:O" & lastRow)
arrBuyer = Array("BuyOne", "BuyTwo", "BuyThree", "BuyFour")
For i = 0 To UBound(arrBuyer)
With Application
chkFind = .IfError(.Match(Range(arrBuyer(i)), Range("O1:O50"), 0), 0)
End With
If Range(arrBuyer(i)) = vbNullString Or chkFind = False Then
MsgBox "Invalid Buyer Code.." & arrBuyer(i)
Range(arrBuyer(i)).Select
End If
Next i
Call runFinished(sFrDt, sToDt, arrBuyer)
Sheets("Main Sheet").Select
MsgBox ("done...")
End Sub
Sub runFinished(sFrDt As String, sToDt As String, arrBuyer As Variant)
Dim SQL As String
' add a new work sheet
ActiveWorkbook.Worksheets.Add
' dispay Criteria
Cells(1, 1) = "Run Date: " & Now()
Call MergeLeft("A1:B1")
Cells(2, 1) = "Criteria:"
Cells(2, 2) = "From " & Range("reqFrDT") & " -To- " & Range("reqToDt")
' SQL
SQL = "select a.StockCode [Finished Part], a.QtyToMake, FQOH,FQOO,/*FQIT,*/FQOA, b.Component [Base Material], CQOH,CQOO,CQIT,CQOA " & _
"from ( " & _
" SELECT StockCode, sum(QtyToMake) QtyToMake " & _
" from [MrpSugJobMaster] " & _
" WHERE 1 = 1 " & _
" AND JobStartDate >= '" & sFrDt & "' " & _
" AND JobStartDate <= '" & sToDt & "' " & _
" AND JobClassification = 'OUTS' " & _
" AND ReqPlnFlag <> 'I' AND Source <> 'E' Group BY StockCode " & _
" ) a " & _
"LEFT JOIN BomStructure b on a.StockCode = b.ParentPart " & _
"LEFT JOIN ( " & _
" select StockCode, sum(QtyOnHand) FQOH, Sum(QtyAllocated) FQOO, Sum(QtyInTransit) FQIT, Sum(QtyOnOrder) FQOA " & _
" from InvWarehouse " & _
" where Warehouse in ('01','DS','RM') " & _
" group by StockCode " & _
") c on a.StockCode = c.StockCode " & _
"LEFT JOIN ( " & _
" select StockCode, sum(QtyOnHand) CQOH, Sum(QtyAllocated) CQOO, Sum(QtyInTransit) CQIT, Sum(QtyOnOrder) CQOA " & _
" from InvWarehouse " & _
" where Warehouse in ('01','DS','RM') " & _
" group by StockCode " & _
") d on b.Component = d.StockCode "
SQL = SQL & _
"LEFT JOIN InvMaster e on a.StockCode = e.StockCode " & _
"WHERE 1 = 1 " & _
"and e.Buyer in ('" & Range(arrBuyer(0)) & "','" & Range(arrBuyer(1)) & "','" & Range(arrBuyer(2)) & "','" & Range(arrBuyer(3)) & "') " & _
"ORDER BY a.StockCode "
I keep getting an error of "Input String was not in a correct format" when trying to run this code.
The outcome is to retrieve data from one listbox to another, transferring only certain sections of the data.
Private Sub LoadButton_Click(sender As Object, e As EventArgs) Handles LoadButton.Click
'checks there is raw data loaded
If RawDataListBox.Items.Count = 0 Then
MessageBox.Show("No Data Has Been Loaded")
Exit Sub
End If
'Splits the raw data into the structure
Try
Dim counterInteger As Integer = 12
Dim FinalDataStructure(RawDataListBox.Items.Count) As FinalData
Dim CleanDataString As String
While counterInteger < RawDataListBox.Items.Count
'reads one row into a string
Dim FinalDataLineString As String = RawDataListBox.Items(counterInteger).ToString
'Splits string by comma
Dim FinalDataArrayString As String() = FinalDataLineString.Split(","c)
FinalDataLineString.Replace("""", " ")
With FinalDataStructure(counterInteger)
.LocationNameString = FinalDataArrayString(0)
.TypeString = FinalDataArrayString(1)
.StateString = FinalDataArrayString(2)
.FemalesInteger = Integer.Parse(FinalDataArrayString(3))
.MalesInteger = Integer.Parse(FinalDataArrayString(4))
'calculate the percentages and totals
.TotalInteger = .FemalesInteger + .MalesInteger
.PercentageFemaleInteger = .FemalesInteger + .TotalInteger
.PercentageMaleInteger = .MalesInteger + .TotalInteger
End With
CleanDataString = "Location" + FinalDataStructure(counterInteger).LocationNameString + ","
CleanDataString += "Type" + FinalDataStructure(counterInteger).TypeString + ","
CleanDataString += "State" + FinalDataStructure(counterInteger).StateString + ","
CleanDataString += "Females" + FinalDataStructure(counterInteger).FemalesInteger.ToString + ","
CleanDataString += "Males" + FinalDataStructure(counterInteger).MalesInteger.ToString + ","
CleanDataString += "Female Percentage" + FinalDataStructure(counterInteger).PercentageFemaleInteger.ToString + ","
CleanDataString += "Male Percentage" + FinalDataStructure(counterInteger).PercentageMaleInteger.ToString + ","
CleanDataString += "Total Population" + FinalDataStructure(counterInteger).TotalInteger.ToString + ","
'Add to list box
FinalDataListBox.Items.Add(CleanDataString)
counterInteger += 1
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
is this normal? I can't click anything in my form when I'm exporting a data to XML from 14k records? And I think my form freeze. I'm using vb.net in exporting file from database. Hope to hear positive response.
CODE :
Using xmlWriter As XmlWriter = xmlWriter.Create(oFileName, xmlSetting)
xmlWriter.WriteStartDocument()
xmlWriter.WriteStartElement("Products")
xmlWriter.WriteAttributeString("type", "array")
oDotNet.SqlDb.strCommand = "SELECT IsNULL(SuppCatNum, '') [Stock No], " & _
" ItemCode, " & _
" IsNULL(CodeBars, '') [BardCode List], " & _
" IsNULL(FrgnName, '') [FrgnName], " & _
" ItemName, " & _
" IsNULL(InvntryUom, '') [InvntryUom], " & _
" b.ItmsGrpCod [Category Code], " & _
" b.ItmsGrpNam [Category Name], " & _
" a.QryGroup1 [Allow Decimal], " & _
" Vat.Rate, " & _
" a.ManSerNum, " & _
" IsNULL(a.CardCode, '-1') [CardCode]" & _
" FROM OITM a" & _
" INNER JOIN OITB b ON a.ItmsGrpCod = b.ItmsGrpCod " & _
" INNER JOIN OVTG Vat ON a.VatGourpSa = Vat.Code " '& _
'" WHERE ItemCode = 'Davies EL-0020 White'"
ts_Progress.Maximum = oDotNet.SqlDb.Ds.Tables(0).DefaultView.Count
For i As Integer = 0 To oDotNet.SqlDb.Ds.Tables(0).DefaultView.Count - 1
xmlWriter.WriteStartElement("Product")
xmlWriter.WriteElementString("id", -1)
xmlWriter.WriteElementString("stock_no", oDotNet.SqlDb.GetField(i, "Stock No"))
xmlWriter.WriteElementString("reference", oDotNet.SqlDb.GetField(i, "ItemCode"))
xmlWriter.WriteElementString("name", oDotNet.SqlDb.GetField(i, "ItemName"))
xmlWriter.WriteElementString("short_name", oDotNet.SqlDb.GetField(i, "FrgnName"))
xmlWriter.WriteElementString("supplier_code", oDotNet.SqlDb.GetField(i, "CardCode"))
'*BardCode*'
Select Case oType
Case 1
Dim _BardCode As String = Nothing
oSql.strCommand = "SELECT BcdCode FROM OBCD bcd INNER JOIN OUOM uom ON bcd.UomEntry = uom.UomEntry " & _
" WHERE ItemCode = '" & oDotNet.SqlDb.GetField(i, "ItemCode") & "' AND bcd.BcdCode != '" & oDotNet.SqlDb.GetField(i, "BardCode List") & "' " & _
" /*AND uom.UomCode = '" & oDotNet.SqlDb.GetField(i, "InvntryUom") & "'*/ "
If oSql.Ds.Tables(0).DefaultView.Count > 0 Then
For oBardCode As Integer = 0 To oSql.Ds.Tables(0).DefaultView.Count - 1
_BardCode &= oSql.GetField(oBardCode).ToString & ", "
Next
_BardCode = oDotNet.SqlDb.GetField(i, "BardCode List") & ", " & _BardCode.Substring(0, _BardCode.Length - 2)
Else
_BardCode = oDotNet.SqlDb.GetField(i, "BardCode List")
End If
xmlWriter.WriteElementString("barcode_list", _BardCode)
xmlWriter.WriteElementString("category_id", -1)
xmlWriter.WriteElementString("unit_name", oDotNet.SqlDb.GetField(i, "InvntryUom")) 'oDotNet.SqlDb.GetField(i, "InvntryUom"))
xmlWriter.WriteElementString("retail_price", "")
'*WhsCode Here*'
Dim _WhsCode As String = Nothing
oSql.strCommand = "SELECT WhsCode FROM OITW WHERE ItemCode = '" & oDotNet.SqlDb.GetField(i, "ItemCode") & "' "
For oWhsCode As Integer = 0 To oSql.Ds.Tables(0).DefaultView.Count - 1
_WhsCode &= oSql.GetField(oWhsCode).ToString & ", "
Next
_WhsCode = _WhsCode.Substring(0, _WhsCode.Length - 2)
End Select
xmlWriter.WriteEndElement()
ts_Value += 1
ts_Progress.Value = ts_Value
Next
xmlWriter.WriteEndElement()
xmlWriter.WriteEndDocument()
End Using
You could try Application.DoEvents this is a very sloppy but easy fix to your problem. It will allow you to use the form still, but it will be very slow.
this is my existing code:
DBConn.BeginTrans
strSQL = "DELETE tblAvailable WHERE "
strSQL = strSQL + "(intResortID = " + Session("TypeID") + ")"
strSQL = strSQL + " AND (dtm BETWEEN CONVERT(DATETIME,'" + cstr(Year(dtmStart)) + "-" + cstr(Month(dtmStart)) + "-" + cstr(Day(dtmStart)) + "', 102)"
strSQL = strSQL + " AND CONVERT(DATETIME,'" + cstr(Year(dtmEnd)) + "-" + cstr(Month(dtmEnd)) + "-" + cstr(Day(dtmEnd)) + "', 102))"
'SY SINGH
'Add code to only delete out room types contained in the spreadsheet
Dim i
strSQL = strSQL & "AND (strRoomType='" & strRooms(0) & "'"
For i = 1 to m_Rooms
strSQL = strSQL & " OR strRoomType='" & strRooms(i) & "'"
next
strSQL = strSQL & ")"
I want to change it to do an update instead, setting curprice where strRoomType is equal to the array of rooms.
this is what I have come up with so far
strSQL = "Update tblAvailable set curprice ="+ FixNumber(curprice (intCurrentData))
response.Write(strSQL)
strSQL = strSQL +"WHERE intResortID = " + Session("TypeID")
response.Write(strSQL)
strSQL = strSQL + " AND dtm BETWEEN CONVERT(DATETIME,'" + cstr(Year(dtmStart)) + "-" + cstr(Month(dtmStart)) + "-" + cstr(Day(dtmStart)) + "', 102)"
response.Write(strSQL)
strSQL = strSQL + " AND CONVERT(DATETIME,'" + cstr(Year(dtmEnd)) + "-" + cstr(Month(dtmEnd)) + "-" + cstr(Day(dtmEnd)) + "', 102)"
response.Write(strSQL)
dim i
strSQL = strSQL + " AND (strRoomType='" & strRooms(0) & "'"
response.Write(strSQL)
For i = 1 to m_Rooms
strSQL = strSQL & " OR strRoomType='" & strRooms(i) & "'"
response.Write(strSQL)
next
strSQL = strSQL & ")"
response.Write(strSQL)
DBConn.Execute strSQL
this is the error I am receiving:
dtm'dtm' OR strRoomType='obeqvb'dtm' OR strRoomType='obeqvb')
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near 'obeqvb'.
/upload_excel_v3.asp, line 230
obeqvb is my strroomtype and dtm is my date
You should escape any single-quotes in your values by doubling them up
'my'roomtype should be 'my''roomtype'
And you're better off using where strRoomType in(...) instead of "or"