Added field to report causes report not to be shown - ms-access

I need to perform a small change to a report running on an old version of MS-Access (2007). The report is based on a simple SELECT statement which, when running it directly vis-à-vis the DB (SQL Server Management Studio) it generates the required data.
A new field needs to be added to the same report and hence the original query was updated to include the new field. Again, execution of the query vis-à-vis the database yields the desired result (including the new field of course).
The new query was deployed into the report (replacing the old one).
Now, I added a new element to the report and set the source of its value to be the new (added) field, which appears in the list of available sources.
The problem is:
When I set the new field as the source of the added object, the report is not generated at all (no error messages are shown either),
If I leave the source of the field as blank, the report is generated (though the new element is shown empty of course),
If I set as the source of the new element any other field shown in the list, the report is generated and the value of the field is being shown correctly.
Can anyone suggest how and where to search for the issue? For instance, try to breakpoint at the opening of the report (if that part of the code is accessible at all).
Unfortunately, I cannot share code nor screenshots (company policy).
Thanks in advance.

Related

Data type conversion from Access to SQL Server errors

I have a SQL Server that is ODBC into my Access which is being utilized as my front end. I created a column in SQL with a BIT data type and created a checkbox with the yes/no data type that uses my SQL Column as its control source. When I go into my form and try to change anything in there and update my tables, I get a writing error and it wont let me append the updates I'm trying to make. As soon as I delete the bit data type, and the check box, then I am able to again append information to my form. Does anyone know a solution or a way I could utilize the Boolean check boxes to report to my SQL Database so that I could track progress of an order, but still be able to append my records? Also if anyone knows why this is happening I would appreciate the information just for my own notes and understanding.
this image shows the column created in SQL Server
This image shows what it looks like in the ODBC table in Access
This image shows the control source I picked which is from a query that utilizes the names of the form comboboxes, text boxes, and hopefully check boxes
This is image shows what happens after I try to update and and close
Thanks
haven't done this for a long time, but the problem could be related to the numbers that are stored. yes/no in access = -1/0, in sqlsrvr = 1/0 (or similar). you could use an INT field in sqlsrvr which will then store whatever access sends (-1 or 0), or keep the BIT but don't use yes/no in access - create a custom yes/no table where yes=1 and no=0 (or whatever BIT needs) and use the custom table as a lookup table for that field which, when updated will send the appropriate value. hope that's all relevant and makes sense.
So I have been messing around with this and after a few other problems running through SQL, Cabinet Vision (our drafting software with a ancient access database) and crystal reports I came to realize that Access cannot accept null values.
So in my SQL Bit data type column I set the default value as 0 and didn't allow nulls. now it records all my check boxes as true or false. and I no longer have a write conflict.
This most commonly arises when a db is developed in Access and at some later date the tables are exported via ODBC to SQLServer. The Checkbox controls on the Access forms were probably placed there using the 'Available Fields' button on the Access 'Design' ribbon. Before getting into complicated solutions with T-SQL modifications to metadata etc, try simply deleting the checkbox control from the problem Access form. Insert an unbound checkbox to replace it, then use the the Properties dialog to set the relevant SQLServer field as the control source for that checkbox. Usually works.

SSRS - Delay Dataset queries

So, I have my report written and all is well. However now I have deployed to my live environment I have a problem; when the report is initially opened it runs all the dataset queries, as I have a large database the report is taking an age to display.
Is there a way to prevent all queries running when the report is initially opened? Would like to run just a single dataset query the populates my first parameter, so the user can begin to filter the data before selecting "View Report" to run the main dataset query with the parameters applied rather than getting everything the instant the report is opened?
I have tried setting default values in the parameters to reduce the initial data load but this seems to have confused the users, so think a blank report with nothing selected in the parameters to start with would be better.
Thanks
FTD
I assume you have some form of following.
QueryLookupState -- Used to fill dropdownlist etc.
QueryLookupCity -- Used to fill dropdownlist etc.
QueryMain , your main query which uses parameters from above.
You gave default parameters to your report therefore SSRS is using that defaults and running your main query to generate report. Change your main query and default parameters so that your main query bring empty result or main query needs parameters from lookups.
You can look following question and answer for same problem. You need at least one non-default parameter, otherwise SSRS will execute your report when it first opened.

#NAME in Access report expression

I have an Access 2007 report which has a table as a data source. I have a few columns of data that directly pull data from the table in a summarized way (using report groups) and the last column is the total of the first 6 columns. Simple enough.
Now the expression that calculates the sum of those 6 columns sometimes returns #NAME? and sometimes does not. I have more than triple-checked for any error, typo, whatever.
There is no space in front of my expression;
The expression does start with an =;
The references to columns in the table are all valid;
No control has a name even remotely similar to any column in the source table;
I have tried generating the expression using the expression builder;
There is no conditional formatting tied to any control;
There is no VBA code used at all in generating the report.
Also, sometimes if I copy the one of the boxes with #NAME?, delete it and paste it back then all the #NAME? errors disappear. Then I save and reopen the report and the errors are back.
I'm out of ideas for this. I can't post screenshots or distribute the file due to its nature.
Thanks !
I had similar problems...The solution was that I have used unicode characters in Names. For example a Text Box with the control source "dataščž" had the Name "datačšž". This was working in previous versions of Access, but not anymore. Changing the Name "datacsz" solved the problem.

MS Access 2007 Add a new control field to report

I have made a report using the report wizard in MS Access. After generating the report I realized that I want to add another value from table (the table is already being used within the report) that I did not include in the report wizard when I generated the report. I have tried adding the new value using the control source option, but it has failed to show up. Please assist in any way you can! Thank you so much for your time. The value I want to add is in table 'tblAuthor' value 'Genre'.
Open the report in design view and check the Record source for the table. If it is a query, you can use the three dots (...) to edit it and ensure it includes Genre. If it is a table, presumably Genre is included. You can then use Add Existing Fields to add a control to the report.

SSRS -> Using code function to create my query dynamically, how do I get at my data (put data into table)?

I am not a seasoned SSRS veteran. I have made quite a few but they were pretty simple.
Today, I am attempting to use the Code tab of the Report Properties to perform some vb functions that will return my query in a string. I am passing in date parameter that is used to create my dynamic query.
My problem/issue is that I do not know how to pull this information into my table.
I have seen instances where a developer calls from each individual field and it calls the code to get a specific field. I was under the impression that I could somehow use a dataset to do this and have some documentation on this, but can't seem to find anything on the web regarding how to do this.
This is probably a pretty poorly written question, but does anyone know how to do this?
I was thinking in the Dataset Properties, I would code something like this in the expression field.
=Code.GetReportDetail(Parameter!InputDate.Value)
GetReportDetail being the starting function within my code window.
I am having difficulties how I can then pull that dataset into my table from that point though.
Any advice on this is greatly appreciated....Thanks.
After further review, I was creating this in VS2010 for RC0 2012 SQL Server, which I should have noted above.
All you have to do is create your report by adding new item (Report). Add your code by right clicking in the pink area and going to Report Properties and pasting your code into the code tab.
Next when you pull a table into your "add item to the report / white space" It allows you to create your dataset.
I chose use dataset embedded in my report. Datasource of OLE DB because I am doing MDX. Query Type Text then in the function I pasted this. (omitting parameters for now) :
=Code.GetReportDetail()
I then filled in fields manually because it seems that dynamic query running does not pull in fields.
I was then able to reference these manually created fields via my table detail row.