Help With This Code / Report
Mar 29, 2006
I have this code in the Record Source of a report. This reports used to run fine without issue and it still does work however, it is running very very slow. I assume that this is because I used to have less records in the table so the build was faster with more and more records it get slower. Is there anyway I can change this to speed things up?
thank you
jim
SELECT [Tble-Passdown].SystemID, [Tble-Passdown].ModuleCh, [Tble-Passdown].[Pareto Chamber Type], [Tble-Passdown].[System Status], [Tble-Passdown].End, [Tble-Passdown].[Xsite Job Number], [Tble-Passdown].[Total Hrs Down], [Tble-Passdown].[Problem Description], [Tble-Passdown].[Service Type], [Tble-Passdown].Timeone, [Tble-Passdown].[Call ID], [Tble-Passdown Sub].[Action Taken], [Tble-Passdown Sub].[Section ID], [Tble-Passdown Sub].[Date Worked], [Tble-Passdown].[EQT Total] FROM [Tble-Passdown] INNER JOIN [Tble-Passdown Sub] ON ([Tble-Passdown].SystemID=[Tble-Passdown Sub].SystemID) AND ([Tble-Passdown].[Call ID]=[Tble-Passdown Sub].[Call ID]) AND ([Tble-Passdown].[Call ID]=[Tble-Passdown Sub].[Call ID]) AND ([Tble-Passdown].[Call ID]=[Tble-Passdown Sub].[Call ID]) AND ([Tble-Passdown].[Call ID]=[Tble-Passdown Sub].[Call ID]) WHERE ((([Tble-Passdown].[System Status])="Down") And (([Tble-Passdown].[Service Type])<>"Reference Only") And (([Tble-Passdown].Deleted)=No) And (([Tble-Passdown Sub].Deletedsub)=No)) Or ((([Tble-Passdown].[System Status])="Up") And (([Tble-Passdown].[Service Type])<>"Reference Only") And (([Tble-Passdown].Deleted)=No) And (([Tble-Passdown Sub].Deletedsub)=No) And (([Tble-Passdown].[Completed Time]) Between #12/30/1899# And #12/30/1899 6:0:0#) And (([Tble-Passdown].[Completed Date])=Forms![Frm-Shift Reports]!Date)) Or ((([Tble-Passdown].[System Status])="UP") And (([Tble-Passdown].[Service Type])<>"Reference Only") And (([Tble-Passdown].Deleted)=No) And (([Tble-Passdown Sub].Deletedsub)=No) And (([Tble-Passdown].[Completed Time]) Between #12/30/1899 18:0:0# And #12/30/1899 23:59:59#) And (([Tble-Passdown].[Completed Date])=Forms![Frm-Shift Reports]!Text1));
View Replies
ADVERTISEMENT
Sep 2, 2005
Hey there, if anyone could help me with the code for opening a report please. I have a main page with buttons, and need a button for opening reports.. thx
View 1 Replies
View Related
Oct 28, 2004
I have a report rptEnvelopes to print envelopes. In the report I have text box called txtRecipientName .
I have a qryAddress with fields notNo, IDCard, Fname, Lname where notNo is a field that takes its value from a combo box called cboSelectEnvelope from a form frmPrinting. I then wrote the following code:
Private Sub Report_Open(Cancel As Integer)
Dim dbLet As Database
Dim rsLet As Recordset
Dim sqlLet, criteriaLet, txtRecipientName As String
Dim stLet as String
Set dbLet = CurrentDb
sqlLet = " Select DISTINCT IDCard FROM qryAddress " & _
"WHERE notNo = " & Forms!frmPrinting!cboSelectEnvelope
Set rsLet = dbLet.OpenRecordset(sqlLet, dbOpenSnapshot)
If Not rsLet.EOF Then
rsLet.MoveLast
stLet = "rptEnvelope"
criteriaLet = "notNo=" & Forms!frmPrinting!cboSelectEnvelopeReports
'This is where I go wrong:
'How to I declare txtRecipientName, on rptEnvelope, to get the value rsLet!Fname&" "& rsLet!Lname
DoCmd.OpenReport stLet, acViewPreview, , criteriaLet
End If
rsLet.CLOSE
NOTE: Private Sub Report_Open is called from the On Open Event of rptEnvelope
View 4 Replies
View Related
Nov 14, 2004
I am using this code on a button, to print a report:
Private Sub buttonPrint_Click()
Dim P1 As Integer
Dim R1 As Integer
Dim stDocName as String
R1 = MsgBox("Print;", vbYesNo)
If R1 = vbYes Then
If stDocName = "FIRST REPORT" Then
P1 = MsgBox("Printing options;" & vbCrLf & vbCrLf & _
" YES: Option 1" & vbCrLf & vbCrLf & _
" ΝΟ: Option 2", vbYesNo "Printing Options")
If P1 = vbYes Then
DoCmd.OpenReport stDocName, acNormal
End If
Exit Sub
Here is the difficulty I need help to overcome:
In report "FIRST REPORT" there is one field called txtSet1, Boolean.
Can I set the value of this field to either True or False from this point in my code ?
If P1 = vbYes Then
set Reports![FIRST REPORT]!txtSet1.value = True
DoCmd.OpenReport stDocName, acNormal
End If
Exit Sub
I know that the answer is NO because the above does not work. I think the problem is that because the "FIRST REPORT" is not opened until line
DoCmd.OpenReport stDocName, acNormal
is executed, the line
set Reports![FIRST REPORT]!txtSet1.value = True
can not find "FIRST REPORT".
Can I have some guidance please ?
Rgds
View 2 Replies
View Related
Mar 16, 2006
I am trying to create a report which is sorted by KeyID, CustID. I don't want to display every Customer record but in the KeyID Footer I would like to display all CustID's associated with the KeyID. I have attached a sample mdb.
TIA,
Valerie
View 1 Replies
View Related
May 5, 2005
Hy,i have some ADO recordset and i want to bind it to blank report that I made in reports.How to do this.
If i create report in reports section and after that i want to see it in my code as that same object and set his record or data source property how to do this??
I know that you can set the recordsource property directly in report but it includes some values from textbox in my form that doesn't show corectly(it's an array of numbers,and i don't know why it doesn't accept it).
Thanks
View 2 Replies
View Related
Feb 10, 2006
I have a report that I use with a couple different parameters. I want to be able to change the title of the report depending on the parameter that is chosen.
I have different OpenArgs set for each parameter and in the report I want to be able to change the Caption on a label depending on the OpenArgs.
The Normal Me.lblHeader.Caption does show as an option like on a form.
The options Me.lblHeader.Form.Caption and Me.lblHeader.Report.Caption show but say Invalid Reference when used.
What am I missing?
Thank you
View 4 Replies
View Related
May 4, 2006
I am creating a report that has the variable address as usual.
Name
Address1
Address2
City, State zipcode
If there is no value for address2, is it possible to shift the locatoin of city state zip up into the Address 2 location? I would like to shift the lable up with code, but can't find a way to do it.
I am using an unbound data source so i have full control over the variable data.
thank you
View 1 Replies
View Related
Jul 7, 2006
I have a report with grouping on a code - I would like to do a page break on the second code - I don't know where to start on this.
View 1 Replies
View Related
Dec 5, 2013
I am trying to add another parameter to a report to only get those specific records. I did not write the code and am very confused on how it works. Right now it is getting records in the Access database between the 2 dates entered. But NOW I need to add a parameter to select only records between those dates AND with the AccountNumber LIKE acctltr (this is the field from the form). They can either put in an "X" or an "P X". The AccountNumber needs to end in which ever one they enter.
Here is the code that is currently existing and supposedly works. At least it gets all the records between the dates even tho it still prints records with a ZERO balance.
Code:
Private Sub cmdprint_Click()
On Error GoTo exit_cmdprint
'mysql = "SELECT * from InvoiceTable " & _
' " WHERE ((not InvoiceTable.InvoicePrintDate1 Is Null) AND (not InvoiceTable.InvoicePrintDate2 Is Null) AND (InvoiceTable.InvoicePrintDate3 Is Null) AND (InvoiceTable.InvoiceDate Between #" & dtefrom & "# And #" & dteto & "#))"
'Me.RecordSource = mysql
[code]...
View 5 Replies
View Related
Nov 13, 2013
I have the following code in the On Load of a report which shows multiple records:-
Code:
If Me.PaymentType Like "Debit/Credit Card" Then
Me.Check94 = True
Else
Me.Check94 = False
End If
This ends up checking all check boxes in the report if any have "Debit/Credit Card" in the PaymentType field.What I wanted was to tick Checkboxes for those records where the statement was true, and not tick those where it is false.Do I need the code in the On Current event? Or do I need more sophisticated code?
View 3 Replies
View Related
May 19, 2014
Can you send a report directly to the printer? We have Clients with multiple Contact Notes, by multiple Clinicians, each of these are separate tables. Every month we print two reports for each client that had at least one contact in that date-range. Usually 200 clients, takes a lot of time. My approach so far is a query within a make-table query to get a list of unique client ID's that had one contact in the date-range. Then I use that table in code to create a recordset, use a Do Loop within that where I print the two reports for the 1st client, move to next record and loop. Now that I've got it working I'm not sure how to print all the reports My 1st question, can you send a report directly to the printer from code? The printer is a networked Konica Minolta Biz-hub so I think it can handle that many jobs being queued that fast.
View 4 Replies
View Related
Feb 25, 2013
Access 2010 - add report to body of an email
i have VBA code to create an email and attach an excel file, what i would like is code to add a report called REPORTMISSINGDATES to the body of the email.
this is the code i have so far, which works and adds everythng i wqant except the main body of the email.
Private Sub Command31_Click()
On Error GoTo Command31_Click_Err
Dim Email As String
Dim name As Variant
Dim EMPloy As Variant
Dim month As Variant
month = MonthName([Forms]![STAFFATTENDANCEMenu]![StaffMonth])
EMPloy = Forms!staffattendancezone!Staff
name = DLookup("[STAFFNAME]", "[QRYSTAFFNAME]", "[ASA] = Forms!staffattendancezone!Staff")
Email = (Forms!STAFFATTENDANCEAdjust!Email)
DoCmd.SendObject acQuery, "STAFFATTENDANCEZONECheckEmployee", "ExcelWorkbook(*.xlsx)", [email], "", "", "" & "Attendance Errors", "THIS IS WHERE I WANT THE REPORT TO GO" _
End Sub
View 1 Replies
View Related
Aug 16, 2013
URL...Essentially it seems like the format event fires only once with a docmd that has a where clause. If I print a single report it is perfect! Example one in the above post has a subreport, example 2 its very simply incorporated into the main report with no sub report.
View 9 Replies
View Related
May 26, 2005
I am wondering if anyone can recommend shareware or free ware Utilities/code to make Form & Report Creation/Edits easier?
I'm thinking of something like Cub Editor http://www.peterssoftware.com/ce.htm or SmartForm+ http://www.aadconsulting.com/smtfrmplus.html
but alas .... I can't do anything that will edit the registry (company politics says Access and it's Wizards is plenty 'perfect' http://www.dbforums.com/images/smilies/frown.gif maybe I will convince the powers that be but not in short time)
Also the code (or forms / reports built) need to work on Access 2000, 2002 and 2003. or well-commented on how to modify as I'm only modest with writng VBA code.
Any ideas? Thanks!
Mark
View 1 Replies
View Related
Sep 9, 2013
I am trying to create some code for a button in a report that will follow a hyperlink to a specific file. The problem I'm having is that the files that are at the end of the hyperlink can have various extensions (*.doc, *.docx, *.pdf, etc.) I'd like to be able to put a wildcard in the code to allow the opening of the file regardless of the extension.
Code so far:
Private Sub Command6_Click()
Application.FollowHyperlink ("C:UsersjbeggDocumentsAccessTestFolder" & [FileName] & ".*")
End Sub
View 11 Replies
View Related
Feb 16, 2006
Works great, but when I hit the number "3", (3 times in row) it will let me into the form. I want it to not let me in IF I don't know the password.
Where did I go wrong?
Private Sub Form_Load()
Dim pw As Variant
If InputBox("What is the password?", "Password") = "1" Then
Else
MsgBox "Invalid Password", vbCritical, "Sorry Charlie"
DoCmd.Close
If InputBox("What is the password?", "Password") = "2" Then
Else
MsgBox "Invalid Password", vbCritical, "Sorry Charlie"
DoCmd.Close
End If
End If
End Sub
View 14 Replies
View Related
Jan 14, 2007
I protect my code from people being able to read it by setting a password on the code from Tools > Properties, selecting the Protection tab and entering a password, and clicking "Lock Project"
Is there a way to write code that will remove that Lock Project check and check it back on?
I've looked through the Application.SetOption command and it doesn't seem to be one of the choices. It would be very helpful if someone knew how to do this.
Thanks
SHADOW
View 6 Replies
View Related
Aug 19, 2007
Does the MS Access Report support Hide/Show specific fields according to parameters or even by click?
View 3 Replies
View Related
Jun 3, 2014
I'v looking for since a couple months a go to make a report direct from access form using crystal report but i havent found it yet. I'v tried this code and its giving me errors. " run time error 1004 method range of object _global failed "
how to make a report using crystal report direct from ms access as front end application ? is it possible to use crystal report ?btw i use database sql server 2008 and MS Access 2007 as my frontend application.here's the code that i'v found and gives me an error
Dim CR As New CRAXDRT.Application
Dim rep As CRAXDRT.Report
Set rep = CR.OpenReport(Range(" ??? ")) * i getting error in this line, what should i do to fill it ??
rep.ParameterFields(1).AddCurrentValue "Boston"
rep.ParameterFields(2).AddCurrentValue "Cars"
rep.Database.Tables(1).SetLogOnInfo "tool", "db_tsel"
rep.ReadRecords
rep.PrintOut promptUser:=False, numberOfCopy:=1 ' promptUser:=True doesn't work
View 2 Replies
View Related
Aug 13, 2015
I have a form with 7 List boxes linked to 7 Query's which in turn are linked to a table. Each list box if for a particular trade.
I am trying to select a person or persons from each List box and then have them sent to a report. I have Code to do one list box, but do not know how to link all boxes with code to a 'Open report' button.
The code I am using is as follows:-
Private Sub cmdOpenReport_Click()
On Error GoTo Err_cmdOpenReport_Click
Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant
'make sure a selection has been made
[code]....
View 9 Replies
View Related
Nov 16, 2014
The aim of what I am doing is to create a monthly statement to give to our intermediaries that shows the commission they will receive each month for the deals they have referred. I have managed to create this report, HOWEVER I can't figure out how to filter out which month I need, so I a report for Jan, Feb Mar etc... The idea is that at the end of each month I need to run the report so only the latest month shows...
View 3 Replies
View Related
Jun 26, 2013
I have a report which programmatically sets the value of some labels based on its own internal logic for each line of the detail section of a report. This all works fine and dandy, using the Detail_format event, and accessing detail.controls.item(x).caption.
HOWEVER, when I then embed the report as a subreport (which I need to do), I goes wrong. Here, I get the values of the last row of the detail repeated in every previous one. I'm suspecting because the parent report has its own 'detail' (I've tried giving the subreport its own distinct detail name).
View 1 Replies
View Related
Dec 21, 2014
How do I hide the report footer based on the report's data ?
I'm trying to hide if number of users = 1
The report's data is a query built inside the report's RecordSource, not a self standing query.
View 10 Replies
View Related
Apr 10, 2014
I've done this once entirely by accident and can't seem to duplicate it...
I have a report. It has the following:
Report Header: Logo and title
Department Header
Supervisor Header
Group Header
Detail
Department Footer: Totals
Report Footer: Overall Totals for all departments
Here's my question.
I have combo boxes on my main form that filter this report. The combo boxes are referred to by the query that runs the report. How do I get proper unfiltered overall totals in my report footer?
View 4 Replies
View Related
Apr 18, 2013
I have a report that displays incidents, their details, consequences and a photo. Among the details is a severity rating high medium or low, I have been asked to make the report shorten the records which have been given a low severity (because it takes up as much space as the more important/severe ones).
The only method I can think of is to use the onformat event, to shrink and make invisible all the fields that I don't want to see if the severity field shows 'low'.
View 3 Replies
View Related