Truncation In Report That Uses Sub-reports
Jul 20, 2007
Hello,
I created a Microsoft Access database that has a data entry form. This “parent” form has two sub-forms. Each sub-form can have many records that map to the same parent record.
I created VBA code to perform a dynamic query based on the fields I select and their associated values (e.g. query by form). The VBA code creates an SQL string that I use to run a query and present the results. I present the results via a report that looks just like my data entry form. The report includes two sub-reports (one for each of the sub-forms used in my data entry form).
On the main page of my report, there is a field called Gen_Comments. This field is of type “memo”. I see that the data in this field is truncated after 255 characters. This is not the case for any of the fields in my two sub-reports. My SQL statement uses the keyword DISTINCT. (Please refer to the SQL statement below). I’m pretty sure that this is what is truncating my memo field because if I remove this keyword and do a query, I do not get the truncation. However, if I remove this keyword, I then get duplicate records in my query.
HELP!! Can anyone determine if there is something wrong with my SQL statement below (which uses two nested inner joins)? Or, is there something else that I can do in conjunction with the DISTINCT keyword to eliminate the truncation? Any help would be GREATLY appreciated.
SELECT DISTINCT [PR_TABLE].*,SubTbl_DefectClassification.DefectNum,SubTbl_Ac tionItems.StepID FROM (([PR_TABLE] INNER JOIN SubTbl_DefectClassification ON PR_TABLE.ID = SubTbl_DefectClassification.DefectNum) INNER JOIN SubTbl_ActionItems ON PR_TABLE.ID = SubTbl_ActionItems.StepID) WHERE (((InStr(1,[PR_Table].PR_Gen_Comments,"The Wavecom",1))<> "0") AND (([SubTbl_DefectClassification].SevLevel) = "Minor") AND ((InStr(1,[SubTbl_ActionItems].Description,"Just a test",1))<> "0"))ORDER BY [PR_Table].ID
I sincerely thank you, in advance, for any help that you may be able to provide.
-Al Oberneder
International Truck and Engine Corporation
View Replies
ADVERTISEMENT
Nov 15, 2006
I already posted this as a response to another thread, but thought I should post it as a new one in case people don't follow threads...
I need to construct a SQL statement to insert a row. The VB code used to construct the insert statement is very long (the actual insert statement will be much shorter). For some reason that I do not understand, it is truncated after 255 bytes.
My VB code is:
Dim InsertStatement As String
InsertStatement = "INSERT INTO tCoverage (CompanyCd, ProvinceCd, " & _
"LOBCd, ProductID, CoverageCd, NBSStartDt, WIPVersion, " & _
"RWLStartDt, ScreenID, WithoutCreditChargeInd, " & _
"GrandfatheredInd, OverrideModeInd, EndorsementTypeCd, " & _
"NoteText, AvailabiltyOfOPCFsTxt, LimitDedTypeCd, LimitDedGroupCd) " & _
"VALUES ('" & Forms!fCoverageDetail!CompanyCd & "', " & _
Forms!fCoverageDetail!ProvinceCd & "', " & _
Forms!fCoverageDetail!LOBCd & "', " & _
Forms!fCoverageDetail!ProductID & "', " & _
Forms!fNewVersionDates!newNBSStartDt & ", 0, " & _
Forms!fNewVersionDates!newRWLStartDt & ", " & _
Forms!fCoverageDetail!ScreenID & ", " & _
Forms!fCoverageDetail!WithoutCreditChargeInd & ", " & _
Forms!fCoverageDetail!GrandfatheredInd & ", " & _
Forms!fCoverageDetail!OverrideModeInd & ", " & _
Forms!fCoverageDetail!EndorsementTypeCd & ", " & _
Forms!fCoverageDetail!NoteText & ", " & _
Forms!fCoverageDetail!AvailabiltyOfOPCFsTxt & ", " & _
Forms!fCoverageDetail!LimitDedTypeCd & ", " & _
Forms!fCoverageDetail!LimitDedGroupCd & ")"
When I look at the InsertStatement string in debug, it looks like the following:
"INSERT INTO tCoverage (CompanyCd, ProvinceCd, LOBCd, ProductID, CoverageCd, NBSStartDt, WIPVersion, RWLStartDt, ScreenID, WithoutCreditChargeInd, GrandfatheredInd, OverrideModeInd, EndorsementTypeCd, NoteText, AvailabiltyOfOPCFsTxt, LimitDedTypeCd, Limi"
It is truncated after byte 255. Does anybody know why this is occurring?
View 3 Replies
View Related
Aug 7, 2006
I just linked a table to an Access Database from SQL Server. Now, whenever I open the linked table, I receive the error "Scaling of decimal value resulted in data truncation."
After a quick Google search (and search of these forums), I found some solutions:
what this means is that your number / data had a whole load of numbers after the decimal point, the length (width) of the field was not enough to display them all so some of the end was got lost
Increase the field size, or, limit the size of the number via the table, in design view, FIELD SIZE
It would appear that somewhere along the way you are
implicitly converting from a decimal value that has high
precision to an integer or other type value that has low
precision. During the conversion their is some data loss
in the form of lost precision.
So, I guess I found the problem, right? I just don't know what I'm suppose to do to correct the issue. There is not a single field in my SQL database that has a precision beyond 10 and a scale beyond 2. So...erm...Why can't Access just deal? What am I doing wrong?
~Andrew
View 1 Replies
View Related
Mar 22, 2013
I'm using Access 2003 to create some reports for an insurance company I work for by interrogating the Informix database of our policy maintenance software via an ODBC connection. The linked tables and the fields included within cannot be edited due to permission restrictions (the software is provided by a third party) but this doesn't usually cause issues.
However, I've recently created a Query that extracts a *number* field from one of our database tables, but I'm having trouble due to the 'Scale' attributed to this field in the Access table settings.
Access recognizes that the field is a 'Decimal' type, but attributes a 'scale' of '0' which causes an error. 'Scale' (for those who aren't aware) refers to the maximum number of digits that can appear to the right of a decimal separator, meaning whenever this value exceeds 0 (e.g. if an advisor enters something like 240.51 - a 'Scale' of '2'), the 'Scaling of decimal value resulted in truncation' error occurs.
As mentioned earlier, we don't have the ability to amend the Scale attributed to this value due to permission restrictions, although I'm told that 'Scale' is set in Access and not on the external database anyway.
how to bypass this issue? I can't reformat the field as Access attributes the Scale upon the initial linking of the table, long before the field is used in any queries. Permission restrictions also prevent me from amending the 'Scale' value in the linked table settings.
The software house themselves can't assist as they've set this value to hold multiple decimals on the actual database. It's as if Access only checks a small proportion of the fields held in the table (the first few hundred of this particular field are whole numbers) and attributes the scale based on this.
View 4 Replies
View Related
Mar 4, 2015
I am getting "Truncation Error" while importing data from Excel to access 2007. I have tried changing the format to short text but the result is the same.
View 3 Replies
View Related
Sep 30, 2005
How do you get to see the entire file path in Access Linked Table Manager of linked tables that are located in a folder with a long path? The problem is that you can only view the first 64 or so characters of the table’s path. This is a real problem when these linked tables need to be updated and you don't know where it’s stored.
Jean-Guy
View 3 Replies
View Related
Oct 2, 2013
I have been an MS Excel man all along my career and I am a novice in MS Access.I have created a table, [Initial Customer Approval] which records data from a Form, [Initial Customer Approval]. Once the data is entered in the Form, I need to do some calculations based on the data entered in some of the fields in the form.I created 6 different queries for the six possible values in those fields. now for each of those queries I created respective reports.I placed a Print command button in the Form.
1. When I press the Print button it should open the report for the current record in the Form. (Currently It Opens all the reports simulatneously, with only one relevant report containing the current record; other opened reports being blank.)
2. If user presses the Print button before pressing Save button then system should prompt user.
Here is the code (Please note [reference number] is the unique ID generated for each record entered in the tabe through form):
Private bSaveClicked As Boolean
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not bSaveClicked Then
MsgBox "You are trying to navigate away from the active record. Please either save your changes, or press ESC to cancel your changes.", vbOKOnly + vbInformation
Cancel = True
[code]...
View 5 Replies
View Related
Dec 28, 2014
I am trying to create a P&L statement in access. I know what I want to come out at the end. I am just starting to play with access and having trouble getting what I want to come out of it.
On the sales side I have a query that gathers all the revenue sources and calculates a total for each date. I then use a second query to just take out the data I want for the P&L report. I created a sub-report that displays the data I want. I use the grouping and grand total features to get the total into the report footer. So far so good.
On the expense side I created a form of a query to manage the one to many relationship to capture the data for expenses (one purchase with many line items). I created a query based of this query to get the relevant data for my expense sub-report. I created the sub-report and got everything looking and calculating the way I want it to. I use the same grouping and grand total features to display the data in the report footer. Still good.
I created a new main parent report with the two sub-reports (sales & expenses) on it and even was able to pull the totals from the sub-reports into the main (so currently the subtotals of the two sub-reports are displayed twice). Now when I try to use the textboxes I used to pull the sub-report totals into the main report to perform additional calculations (sales - expenses) I get #error. I have tried different things and gotten ?name.
Control source for the two textbox controls on the main that display correctly, but don't let me do any further calculations.
=[rptP&LExpensesOverview]![AccessTotalsAmount]
=[rptP&LSalesOverview]![AccessTotalsTotal Sales]
To do the subtraction I have tried using the references above, as well as just using the names of the unbound text boxes in the report that bring the totals into the main report.
As a work around, I tried to build one query with all the data from sales and expenses, but can't "filter" based on date and get the data I want in the query results because the two sets of data are not necessarily related. I either get a long list of records, or no records (I am currently only playing with about 5 days of data).
View 2 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
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
May 24, 2015
We have a shift log that includes both personnel actions during any given day as well as operational actions. (We recently switched from a word document to an Access Database to allow multiple users to input events while another has the logbook open already (which you couldn't do with Word))
At the beginning of each day, my manager reviews the previous days log and forwards up pertinent data (some personnel, some operational) to our higher authorities. Is there a way to allow him to select which records he'd like to include on that higher-authorities report straight from the local-level report?
I'm not a fan of allowing him a "Save As" feature because that kind of defeats the data integrity purpose of an events log where he could save as an RTF and then edit any of the log entries without any checks or balances.
View 2 Replies
View Related
Jun 26, 2013
I have an odd thing happening with my reports. There is a main report that gives class information (from query). There are two subreports (from queries also ) with scores (one for each type of test). There are some unbound controls on the main form that display a count of how many scores are recorded which are totals from the subreports. The controls all report the correct numbers however, when I scroll down to view each record, some of them change to #error, or #name, or similar for a moment. Sometimes they will stay in error form when I stop scrolling but change to correct if I scroll up just a bit. Is this because the controls won't calculate unless that report record has focus?
View 1 Replies
View Related
Dec 18, 2013
Is there a way to hide a label on a report if the sub report count is 0?
View 2 Replies
View Related
Feb 18, 2015
Is there a way to have say five different reports that give out information and at the bottom the totals. I would like to take each of those separate reports to create one report with just the totals.
View 3 Replies
View Related
Mar 20, 2015
So I have a text box in a report that I want to pull in data from a field in another report, so the 'control' for my text box looks something like this...
=[Reports]![rptSalesReceiptSub]![Text141] (i.e Text141 is the data I want to pull into my report)
...the path is completely correct but when I run my report I get.#Name? If I run the report that has the data I want, it's fine (in other words Text141 has valid data in it)
View 4 Replies
View Related
Jul 11, 2013
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!
View 3 Replies
View Related
May 25, 2013
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:
Code:
Me.txtAddrMainLine2 = "NAME " & UCase([Forms]![frm_OrderRx].[txtPatientName])
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.
View 3 Replies
View Related
May 5, 2013
I have debit & credit column.
Which I use this in the report --> =IIf([PaymentMet_trans]=2,"",[Amount]) debit = 1 , credit = 2...
Now, i would like to have the total sum of it. according to the debit & credit separately instead of the whole total sum.
i did this : =Sum(IIf([PaymentMet_trans]=2,0,[Amount]))
error pop up : this expression is typed incorrectly or is too complex etc etc ...
View 1 Replies
View Related
Jun 24, 2006
I have designed many queries in my db and report for every single query. Each report has count filed. =Count(*).
Now I want a report to show these count fields. Which will serve purpose to get overall summary report. I have tried using
[Report]![name of field]
but it does not work.
Could somebody please help?
View 1 Replies
View Related
Sep 9, 2013
I have a report generated by a query.
The query shows the total rent collected per property and the total expense per property. It then has a sum in it to work out the total profit - SUM(rent collected - expense paid.).
This works fine and the report works fine. But i want to add the totals in the bottom of the report.
So i have three unbound text boxes, one for each column. And the control source is
Sum([rentcollected])
Sum([expensepaid])
these two work fine, but then i have tried to work out the total profit but can't get this working. If i do Sum([profi]) this doesn't generate the real profit as it just totals the profit column which might have negatives.
If i put in sum([txtTotalRentCollected]-[txtTotalExpensePaid]) then when running the report it prompts for the values of the text boxes - these are the names of the text boxes the totals are calculated in.
View 1 Replies
View Related
Jun 5, 2013
I have a report based on a query with a between two dates parameter (Begin date and end date). This parameter is fed from a form. All works well - query, form and report. My question is can the date parameter appear on the report header so users know the report was based on a start date of 1/1/2008 and an end date of 1//2009 for example?
View 4 Replies
View Related
May 11, 2013
After changing data source , header and name of report, only the design view tab changes to the new name of the report. i.e. Changed copy of "Fiscal Quarter 01 Report" to "Fiscal Quarter 02 Report". When open in design view, name tag of report is "Fiscal Quarter 02 Report". In any other view, name tag of report is "Fiscal Quarter 01 Report". If I need to have both reports open in report view, they both have "Fiscal Quarter 01 Report" on the name tab - Very Confusing! How do I get all tabs for a renamed report changed to the new name?
View 3 Replies
View Related
Jun 13, 2014
My report has a header that contains "Shipped-From" and "Ship-To" information. I only display this on the first page of my report by using some code in the Page Header section. The problem is that the field names of the detail section are also in the header. This means that from the second page on the field names are absent. What can I do to include the field names in all of the pages - but the "Shipped-From" and "Ship-To" information only on the first page?
View 3 Replies
View Related
Nov 21, 2014
I have a DB that is split to a back and frontend.
The FrontEnd is published on a Citrix server, so is the backend. It works well, but I have issues with images in report.
We have a lot of suppliers that demand that we use their standardized forms for entering customer information.
Most of these forms are quite simple and basic (logo in the corner and so on), and this does not represent an issue to just mock them in a new report.
However, one of our suppliers has multiple pictures, their own font for text, "complicated" boxes with text (for example they do not use rectangles, but cut of corner rectangles) and so on. It's a nightmare to recreate.
The FrontEnd file was about 25mb when i startet, and after creating 2 reports of 6 pages, the frontEnd size increased to over 350mb.
I have saved the pdf as an image (jpg). I need high resolution because of small tekst in the pdf that needs to be visible. I have managed to get the size down to 2mb, some 4mb. Any lower and the image is unreadable. I have also tried BMP (I've heard that bmp i preferable).
All of this is quite time consuming, and I have used hours after hours recreating these reports, without satisfactory results.
Sometimes the images are visible on the print, other times not. The same with the print preview.
So my question is... How can I "create" a report, based on a PDF?
View 9 Replies
View Related