How can I eliminate #error in SSRS expression - reporting-services

=CStr(First(Fields!AXPPaymentTerm.Value, "SalesInvoiceHeaderFooterDS")) & vbcrlf &
iif(First(Fields!AXPSpotRateCurrency.Value, "SalesInvoiceHeaderFooterDS") = 1,"",
"Rate of exchange : " &
First(Fields!AXPSpotRateCurrency.Value, "SalesInvoiceHeaderFooterDS") & " " &
First(Fields!AXPSpotRate.Value, "SalesInvoiceHeaderFooterDS")
)

=CStr(First(Fields!AXPPaymentTerm.Value, "SalesInvoiceHeaderFooterDS")) & vbcrlf &
iif(CStr(First(Fields!AXPSpotRate.Value, "SalesInvoiceHeaderFooterDS")) = "1","",
"Rate of exchange : " &
First(Fields!AXPSpotRateCurrency.Value, "SalesInvoiceHeaderFooterDS") & " " &
First(Fields!AXPSpotRate.Value, "SalesInvoiceHeaderFooterDS")
)

Related

How to design my html code inside my asp.net code?

How can i put some design in my HTML code inside the vb.net code?
I want to change the font design inside my body tag as the text in my body tag will send in users email address. Your help will greatly appreciated.
here's my code:
mail.Subject = "SYSTEM REQUEST FORM " & txtRequestTitle.Text & " " & Format(Now(), "MM/dd/yyyy").ToString
mail.IsBodyHtml = True
mail.Body = "<html>" & _
"<body>" & _
"Dear " & DropDownApprover.Text & ",<br><br>" & _
"" & "The following request has been created and need your approval" & "<br>" & _
"" & "===============================================" & "<br>" & _
"" & "http://10.190.193.162/ITrequestform/LoginPage.aspx" & "<br>" & _
"" & "===============================================" & "<br>" & _
"" & "Requested By: " & lblName.Text & "<br>" & _
"" & "Need to Approve By: " & DropDownApprover.Text & "<br>" & _
"" & "===============================================" & "<br>" & _
"" & "Request Title: " & txtRequestTitle.Text & "<br>" & _
"" & "Request Category: " & DropDownCateg.Text & "<br>" & _
"" & "Request Item: " & DropDownCateg2.Text & "<br>" & _
"" & "Date Needed: " & txtDateNeeded.Text & "<br>" & _
"" & "===============================================" & "<br>" & _
"" & "For Employee: " & txtRequestEmp.Text & "<br>" & _
"" & "Position: " & txtEmpPost.Text & "<br>" & _
"" & "Description of Request: " & txtDescription.Text & "<br>" & _
"" & "Justification of Request: " & txtJustification.Text & "<br>" & _
"" & "<br>" & _
"Thanks," & "<br>" & _
"HKT Teleservices""<br>" & _
"</body>" & _
"</html>"
Add CSS in project:
In SolutionExplorer --> Right click o project --> Add existing item and select Stylesheet(CSS).
Use CSS in ASPX page:
You need to add refererence for this CSS file in ASPX page
<link href="Stylesheet.css" rel="stylesheet" type="text/css" />
Any style you want to apply to your body text you can write in the code below
And in the Stylesheet.css file, , write this code
body{
font-family:"Helvetica Neue" , "Lucida Grande" , "Segoe UI";
font-size:20px;
}

Run-time Error '3061' Too few parameters. Expected 8

I'm trying to create a vba code to append some data to a Table named T_Tickets
Below the code I'm using.
Function addticketScheduleChange()
Dim route As String
route = InputBox("Please enter the URL for the ticket:", "Schedule Review")
Set db = CurrentDb
Dim frm As Form
Set frm = Form_Frm_View_Team
sSQL = "Insert INTO T_Tickets ([CSA Login],[Team Manager],[Schedule Description],[WF Shift Pattern],[Mytime Schedule Description],[Shift Pattern Description],[Mytime Description Code],[Type of Ticket],[Resolved?],[Date Submited],[Ticket Link])" _
& "Select " _
& "frm.[CSA Login]" & ", " _
& "frm.[Team Manager]" & ", " _
& "frm.[Schedule Description]" & ", " _
& "frm.[CSSM SPD]" & ", " _
& "frm.[Mytime Descrription]" & ", " _
& "frm.[Shift Pattern Descr]" & ", " _
& "frm.[MytimeDescriptionCode]" & ", " _
& "'Schedule Change'" & ", " _
& False & ", " _
& "Now()" & ", " _
& "route"
db.Execute sSQL
MsgBox ("Record saved.")
End Function
Any help is appreciated.
Try this:
sSQL = "Insert INTO T_Tickets ([CSA Login],[Team Manager],[Schedule Description],[WF Shift Pattern],[Mytime Schedule Description],[Shift Pattern Description],[Mytime Description Code],[Type of Ticket],[Resolved?],[Date Submited],[Ticket Link]) " _
& "Values (" _
& "'" & frm.[CSA Login] & "'," _
& "'" & frm.[Team Manager] & "'," _
& "'" & frm.[Schedule Description] & "'," _
& "'" & frm.[CSSM SPD] & "'," _
& "'" & frm.[Mytime Descrription] & "'," _
& "'" & frm.[Shift Pattern Descr] & "'," _
& "'" & frm.[MytimeDescriptionCode] & "'," _
& "'Schedule Change'," _
& " False, " _
& " Now(), " _
& "'" & route & "')"

Access VBA code : How to define multiple WHERE statements ? UPDATE - SET - WHERE statement

I got following code to work, except for the last line.
So I want to update a table called loggingX , this is working with the code below, except for I want the WHERE clause to not only check for 1 field (this is working) , but I want the WHERE to also check for field WHid to be a fixed value.
I would like to know how I can add multiple parts to my WHERE statement here. UPDATE should only be done if these 2 conditions below are met. I only have trouble and want to know how to put both conditions in the WHERE clause.
stdid=" & Me.txtID.Tag
WHid=" & Me.txtWHid
Complete update statement for current DB (AND is not working):
CurrentDb.Execute "UPDATE loggingX " & _
" SET stdid=" & Me.txtID & _
", stdname='" & Me.txtName & "'" & _
", gender='" & Me.cboGender & "'" & _
", phone='" & Me.txtPhone & "'" & _
", address='" & Me.txtAddress & "'" & _
", WHid='" & Me.txtWHid & "'" & _
" WHERE stdid=" & Me.txtID.Tag
" AND WHid=" & Me.txtWHid
You're missing an ampersand and underscore on the second to last line:
CurrentDb.Execute "UPDATE loggingX " & _
" SET stdid=" & Me.txtID & _
", stdname='" & Me.txtName & "'" & _
", gender='" & Me.cboGender & "'" & _
", phone='" & Me.txtPhone & "'" & _
", address='" & Me.txtAddress & "'" & _
", WHid='" & Me.txtWHid & "'" & _
" WHERE stdid=" & Me.txtID.Tag & _
" AND WHid=" & Me.txtWHid

VB+Crystal report

I wrote this code but I got "Run time error '91':"
Private Sub Command1_Click()
Set rs = New ADODB.Recordset
openConnection
If Me.cmbMonth = "" And Me.cmbYear = "" Then
MsgBox "Please select MONTH and YEAR"
Exit Sub
End If
With crystalrpt
.ReportFileName = App.Path & "\Report\VariableReport.rpt" <-- ERROR IS HERE
.SelectionFormula = "{SW.dtaMonth}='" & cmbMonth.Text & "' and {SW.dtaYear}=" & dtaYear.Text & "" & _
" and {SFW.dtaMonth}='" & cmbMonth.Text & "' and {SFW.dtaYear}=" & dtaYear.Text & "" & _
" and {OT.dtaMonth}='" & cmbMonth.Text & "' and {OT.dtaYear}=" & dtaYear.Text & "" & _
" and {CL.dtaMonth}='" & cmbMonth.Text & "' and {CL.dtaYear}=" & dtaYear.Text & "" & _
" and {RM.dtaMonth}='" & cmbMonth.Text & "' and {RM.dtaYear}=" & dtaYear.Text & "" & _
" and {EL.dtaMonth}='" & cmbMonth.Text & "' and {EL.dtaYear}=" & dtaYear.Text & "" & _
" and {TRANS.dtaMonth}='" & cmbMonth.Text & "' and {TRANS.dtaYear}=" & dtaYear.Text & "" & _
" and {WD.dtaMonth}='" & cmbMonth.Text & "' and {WD.dtaYear}=" & dtaYear.Text & "" & _
" and {MP.dtaMonth}='" & cmbMonth.Text & "' and {MP.dtaYear}=" & dtaYear.Text & "" & _
" and {NONSTOCK.dtaMonth}='" & cmbMonth.Text & "' and {NONSTOCK.dtaYear}=" & dtaYear.Text & "" & _
" and {PACK.dtaMonth}='" & cmbMonth.Text & "' and {PACK.dtaYear}=" & dtaYear.Text & ""
.WindowTitle = "Report"
.Action = 1 'Will Show The Report
End With
End Sub
It's possible that you are trying to create an instance of a class (an object) from a class that is present on the machines you tested it on, but not on the machine it's been deployed to..... for example, I happen to know that I can make a VB program utilize a class for Nero Burning Rom.... I can make a nero object, and use it's methods and properties...... but that will only work on machines that have the Nero libraries installed. If it's not installed, when you try to make the object (either through early or late bindings with new or createobject), the variable that SHOULD refer to the object is still set to Nothing, because the library failed to create an instance of the requested class.....

"operation is not allowed when the object is open"

When I am trying to execute the program I am getting an error like "operation is not allowed when the object is open". I'm using vb 6.0 and microsoft access database. here is the source code
Private Sub cmdDelete_Click()
dtaOverhead.Recordset.Open "Delete from variable where SWACTFM= " & txtEntry(0).Text & " And SWBUDACT = " & txtEntry(1).Text & " And SWREMFM = '" & txtEntry(12).Text & "' And SWACTRAW = " & txtEntry(2).Text & " And SWBUDRAW = " & txtEntry(3).Text & " And SWREMRAW = '" & txtEntry(13).Text & "' And SWACTWHS = " & txtEntry(4).Text & " And SWBUDWHS = " & txtEntry(5).Text & " And SWREMWHS = '" & txtEntry(14).Text & "' And SWACTLAB = " & txtEntry(6).Text & " And SWBUDLAB = " & txtEntry(7).Text & " And SWREMLAB = '" & txtEntry(15).Text & "' And SWACTWORK = " & txtEntry(8).Text & " And SWBUDWORK = " & txtEntry(9).Text & " And SWREMWORK = '" & txtEntry(16).Text & "' And SWACTTOTAL = " & txtEntry(10).Text & " And SWBUDTOTAL = " & txtEntry(11).Text & " And SWREMTOTAL = '" & txtEntry(17).Text & "'"
MsgBox "Record deleted successfully !", vbInformation, "Deletion Successful"
Call Filllist
Call clearall
cmdSave.Caption = "&Save"
End Sub
You can't open a Recordset twice (er, without closing it in between anyway).
A DELETE would normally be done using Connection.Execute or Command.Execute, not Recordset.Open.