I am wondering if it is possible to send a report as xls file and keep the format exactly as the report looks.When I try to send it now, it automatically changes back to the column names from the table, which I in the report have changed and want to keep in my excel output!
I have an report that uses name paramaters.this is the sql for the report
Code:
PARAMETERS [whatCompany] Text ( 255 ); SELECT tblInvoices.ClientCompany, tblInvoices_Details.Charge, Sum(tblInvoices_Details.Hours) AS SumOfHours, tblInvoices.InvoiceID FROM tblInvoices INNER JOIN tblInvoices_Details ON tblInvoices.InvoiceID = tblInvoices_Details.InvoiceID GROUP BY tblInvoices.ClientCompany, tblInvoices_Details.Charge, tblInvoices.InvoiceID HAVING (((tblInvoices.ClientCompany)=[whatCompany]));
How do I pass the paramaters to the report? I've tried several different ways but can't get it to work
Code: Dim stdocname As String Dim stLink As String stdocname = "RptWithParm" stLink = "ClientCompany = " & "'" & Me.lstCustomer & "'" 'Using the field name doesn't work DoCmd.OpenReport stdocname, acViewReport, , stLink
'When I try to set the value of the paramater that doesn't work either stLink = "[whatCompany] = " & "'" & Me.lstCustomer & "'" 'using the paramater name doesn't work DoCmd.OpenReport stdocname, acViewReport, , stLink
I know I could use the value of the form in the criteria like this
Code: HAVING (((tblInvoices.ClientCompany)=[Forms]![frmTesRptParm]![lstCustomer]));
If I use the list box as the criteria I want to be able to use reports in other than one place, plus there are over 80,000 records and it'll run faster if I set the criteria before the report opens instead of setting a filter after it opens to only show up to about 100.
I've made a report on a blank report template. I've dropped in 5 sub reports. I have entered into the criteria for each of the queries based on [forms]![ClientForm]!CleintID. to run the report. It wortks but I have to enter the ClientID 5 times. Usually, when I create a button to run the form from, it only asks for the CleintID once. The 5 reports are based on 3 separate queries.
I want to sent out my report as a pdf file with my macro.. I've been trying to use the VBA
Code: Option Compare Database
Sub Fix1() DoCmd.SendObject acSendReport, "MarketRiskControl_HighestDiffs_AsOfCurrentDate", "PDFFormat(*.pdf)", "my mail@mail", "cc", , "SD Counterparty Report as of Current Date", "Regards, Trading Risk Control", False End Sub
Send only one or two pages of a multi-page report. I have a report that has three pages. I only want to send the first two as a pdf file. Can this be done with VBA? I know it can be done using Exporting Data on the External Data ribbon, but how can I do it via VBA?
I have a navigation form that will have 6-8 tabs. We were using about that many databases, but we are finally consolidating them into one. The result of us using so many databases has been the multitude of forms and reports that were necessary for each database prior to merging them together.
The problem: There will be anywhere from 12-20 (text boxes) that the user can use to search anything in our database. What we need to have happen, if possible, is for those search parameters to show up in the header of our report if they have text in them. If the text box is blank, it should not show up in the header of the report.
I have read how to to do the start/end date technique, but I do not know if that would work for what we are doing since the boxes would only show up if they are populated by the user.
I have an unbound form with an associated report. When the user hits the 'print' button on the form/screen, the report is launched in the background. In the On Load event of the report I populate the report fields from the forms field as so:
This works like a charm as long as I call the report in Print Preview mode (i.e. with acViewPreview). But if I send the report directly to the printer, none of the fields print.
I've read about using other report events to populate the fields (e.g., On Format and On Print) and also something about using TempVars to pass the data. But I haven't read anything that's clear and definitive about the full answer.
What I have is a single table that I need to create a report from. It has vehicle unit numbers, dates of service, repair details and costs. I am trying to generate a report where I can select a unit from a combobox and enter a date range.
Is there a way of doing the above? I have several distribution lists (some >100 recipients) defined in Outlook, and would like to use the Docmd. Send Object command to send messages to one or several of them. I cannot find a way of defining a distribution list as any of the To, Cc or Bcc parameters.
I have a form that the user can add Work Order numbers to a text box and pass them to a listbox to collect 1 or more values. Each of which need a separate report with the labour hours for each Work Order.
I am having issues figuring out how to get it to pass them to a query or filter the reports.
I have tried many different examples and nothing seems to work.
I've created a database where I have all the information for people like name, address, etc. Then there's a list box to choose what events they will be attending. I want to be able to run a report and see all the information for the people who are attending any specific event. Is there a way to create a form where I can click a button then it brings up the screen to choose the parameters of my report, then generates the report? Thanks!
I am trying to figure what code to use. What i am trying to accomplish is when the use clicks to open a report i want a form to open and make them choose from a combo box a "training activity". then the report will generate info for that activity only.
I have a contract management database where contracts have a start date and an end date. I also have a date parameter set up whereby I can show live contracts between overlapping records.
I want to be able to count the number of days for each contract that is live between the dates of the parameters.
For example my contract might run from 1st to 30th November but I might want to report from 10th October to 10th November so the number of days I need the query to return is 10 days as my contract is not live before the 1st November. Or my query might run from 1st October to 31st December, then I would need it to show 30 days as it covers the whole of this contract.
I have a report with a nested Subreport. Main Report>Subreport1>Subreport2, for simplicity.
I have master/child set up for both Subreports, but I would also like to filter the Subreport2 records with a date range parameter.
Is there a way to get the Subreport2 where clause to recognize the Subreport1 control I want to use for the date range?
So far I have tried:
Between Int([Reports]![Processing_Performance_Req_Dataset]![report]![QC_Static_Processing_Subreport]![Collection_Date]) And (Int([Reports]![Processing_Performance_Req_Dataset]![report]![QC_Static_Processing_Subreport]![Collection_Date])+0.9)
Between Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport]![Collection_Date]) And (Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport]![Collection_Date])+0.9)
and
Between Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport].[Report]![Collection_Date]) And (Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport].[Report]![Collection_Date])+0.9)
where Processing_Performance_Req_Dataset = Main Report QC_Static_Processing_Subreport = Subreport1 and Collection_Date = textbox control on Subreport2.
Is there a syntax error? I have other, single level, Subreports on the main report with a similar data range parameter that work just fine. Or does this type of parameter input not work on second level Subreports? Every time I run the main report it asks me for a parameter but doesn't accept my input, and Subreport2 doesn't load any records.
I have a field in a table called reasons. Then I have a list of possible reasons in a drop down list for my form. I want to create a report that allows the user to select from a drop down of these reasons and do a query for only those records with that specific reason. I know you can ask that info be typed in by using brackets in the query but instead of typing the reason I want to be able to select from the drop down list to produce the report. Can this be done?
With the code below , I send the report: “ESERT4H”, in email body. How I could add yet another report on the same body of the email ?
DoCmd.OutputTo acOutputReport, "ESERT4H", "HTML(*.html)", "D:Access empESERT4H.html", False, "", 0, acExportQualityScreen Dim Out As Outlook.Application Dim NS As Outlook.NameSpace Dim Folder As MAPIFolder Dim Mens As MailItem
The input form of the database have one common table containing data for all parameters for row source. As all data was in one table had one ID. My problem is I am trying to run reports from a form after selecting dates and parameters.
For selecting parameters I created dynamic combo box. For dynamic combo box I needed ID and description of the parameters. So I created separate tables for each parameter with ID and Description column. Which ran me into the problem that when I run report based on main input form which has different row source table and my report form has different row source tables and reports doesn't run when I base my queries on the report form.
I created a report using wizard and altered the parameters to what I need on my report and saved it as a new autoformat. The autoformat did not retain the parameter adjustments I made...only the basic format...no size changes...grouping I added ...a seperator line between the groups and the bound items I deleted that I did not want were still there. All I want to do is to be able to use the report format I created numerous times as it is without me having to go in and make adjustments with each query I pull a report from. There are several different query's with different tables involved. To sum it up one report format to use multiple times....Help Please!
I would like to run a report that uses a stored procedure with parameters. Is there a way I can pass the parameters from the report to the stored procedure? I am NOT running it from a form.
I want to call the report from VBA code and pass it the parameters that are necessary to run the stored procedure. Any ideas?
I need the following report to open with date parameters. I have the following code, but it doesn't quite work.
When an item is chosen from Modl (a list box) a box pops up asking for LowPop, then another for Start Year and then another for End Year.
Those last two aren't doing what they should. They should restrice the [Date] field to between the years entered as start and end. I would like to put it in the "OpenReport" line, but don't think that's going to work.
Code: Private Sub Command27_Click() Dim varItm As Variant Dim ModelWhere As String Dim strQuery Dim LowPop As String Dim SDate As Date
Im new to access and i have a problem!! I have a report that i need to be sent out monthly to 3 people. The problem is i dont know where to start. I have been looking through the forum, but nothing that i can get my head around, so there anyone out there who can help???????
I am trying to send an MS Access 'report' as an attachment to a mail recipient in rtf format without success. Everything seems to work fine except the 'send' button. Click away and nothing happens.... no error messages, no nothing. Any suggestions or tips on how to make this work?
I use this to send email msgs through gmail, found it on the net somewhere, adapted a bit and it works.
Code: Private Function fSendGmail() As Boolean 'Returns True if No Errors are Generated On Error GoTo Err_ErrorHandler fSendGmail = True Const conStrPrefix As String = "http://schemas.microsoft.com/cdo/configuration/" Const conCdoSendUsingPort As Integer = 2
[Code] ....
Err_ErrorHandler: If Err.Number <> 0 Then fSendGmail = False etc, etc End Function 'fSendGmail
I'd like to send report attached to this as pdf or rtf. How should I go about it. I know how to create pdf and save it.(DoCmd.OutputTo acOutputReport, "My Report", acFormatPDF, strPath, True) But where do I attach that here? Is it necessary to save the file first?
I use a macro that attaches a document automatically to an e-mail address ready to send this report is governed by a query of which the criteria is " loss order number " this is in a pdf format of which I need if possible
The problem I have is the same pdf file keeps attaching itself to the e-mail no matter which loss order number I select. The reason I think is because the report is called NCR so it is not changing from the previous one. What I think can solve it but not sure and don't know how to do is get the " loss order number " within the report name.
If I just send the report to a file direct it does work as I am prompted for a file name
Can the loss order number get into the file name within a macro/vba