MS Access Report "per detail" formatting and accessing in VBA - ms-access

Im trying to access MS Access Report detail instances of a report page in VBA so i can do some formatting on each entry in the report.
Im not sure if this is possible as im trying to create a report which shows positive and negative differences between specific text boxes of 2 detail sections (only 2 will allways be visible on a report page).
I know how to code colours and the differences - i would just like to know how and if i can access those instances of text boxes in the detail sections so i can compare their content.
Im not a big fan of VBA so im not much knowledgable on the subject
Any help much apreciated!

As far as I understand your problem, the best way would be to use the "Format" event of the report's detail section. This event is fired every time a record is formatted to be displayed in this section, so Me.txtMytextcontrol.Value should give you access to that very control at that time.

Related

Odd behaviour in MS Access

Right now I'm working on an application in access 2010 that generates letters based of data taken from a share point site. The user inputs some parameters from some combo boxes on a form. After the selection is made the user selects the type of letter they want by pressing a button.
This works fine but I'm experiencing an odd issue when I close access and reopen it later.
When I open the form after starting access again I'll attempt to create a letter but instead of working like it did before the criteria prompt window appears asking for a parameter instead of taking the form values.
This happens every-time I restart access and the way I've been fixing it is by changing the names of the combo-boxes and then adjusting the queries accordingly.
This is what i was using to get the form values in the query
Like [Forms]![Main Menu]![A] & "*" (A is the name of the combo box, I got tired of renaming it)
Any Idea whats going on because I'm at a loss.
Thanks in advance!
If you are 100% positive that Access is finding your parameters just fine, and when Access closes they are lost, then:
Do you have any backup copies of this database before the error
occurred? Can you use one of them?
Do you Compact & Repair the database every time you close it? This
can be used somewhat as "damage control," because MS Access does
have a tendency to become corrupt.
Make sure the Main Menu form is open as long as the query is
running. Does it close right away (aka the query isn't finding the
parameter because the form is closed)?
From searching around, it seems that you aren't the only person with this problem. A known fix for people seems to have been copying all objects into a new database (which to me, sounds like the database is corrupt.) This could also mean maybe only your form is corrupt. Perhaps try to create a new form that does all of the same things that your Main Menu form does.
I'm sorry there doesn't seem to be a 'clear-cut' definitive solution for your situation.
If any VBA is involved, see below:
If you use the "Database Documenter" feature and check "yes" to all the options, you will obtain an exhaustive report that should let you trap your problem parameter. Export this report as an .rtf or .pdf document, so it is searchable. Identify a keyword from the dialog prompt, and search on that.
Once you check the query objects using the Documenter, check your VBA code. You'll do this by stepping through code in the IDE. If the main form has subforms, they are opened with (within) the main form. And they load before the main form.
Identify those subforms.
Sprinkle breakpoints in their code modules (if you find a Load function, that is highly relevant).
If the main form has a code module, do the same there.
From this thread

Reporting in MS Access

I am looking for some advice on strategically embedding reports in forms to allow for optimal end-user usage.
In particular, i would like to know if it is possible to have a report embedded into a form but so that the header of the report changes as you scroll down to show the title of the current type of record you are looking at.. As an example, i have a report with about 1000 lines of information relating to 5 category types.. I made a report so that the category type is Always in the header of the report. Is it possible when viewing this report embedded into a form to have this functionality??
Thank you,
A
A quick Google search indicates that Microsoft does have an ActiveX control available which does allow you to embed reports inside forms. It's called the Microsoft ActiveX Snapshot Viewer. Most of the search results indicate that there are vulnerabilities with it, which is often the case with old ActiveX controls.
Even if you do utilize it (which I do not recommend), you're going to run into a problem where you won't know what category the user is viewing, since I'm not aware that Access gives you any way to get that information.
I suggest you use forms instead. Reports are for printing, and in my opinion, for nothing more than that. A preview should allow the user to see very quickly what it will look like, and then print it.
It isn't that hard to build forms that allow users to search/filter. I find that when I build proper searching/filtering forms, my users don't need reports unless they really do need to print something. Forms can be built as read only so they can't change data.
Be aware that even with forms, I don't think it's possible to know what the user is viewing. If they click into a record you would be able to use the OnCurrent event to know what record they are viewing and could likely derive the category from that, but that requires them clicking around in forms. A much more standard way of doing this would be to give them a dropdown which would allow them to select a category and apply a filter to the form (or a subform) to view only that category.

printing navigation subform in ms access 2010

I recently created a database application in MS Access 2010 using navigation subforms. The users of this database are used to printing out forms with data from individual records. The navigation subforms cannot be printed in MS Access 2010. I read that I should use reports for printing individual records, and I am in the midst of creating reports for each of the forms. The task of creating all the reports is so laborious that I am concerned about the ability to maintain the database over time. Whenever we change a form, we will also have to change the corresponding report, because both look identical.
Can someone suggest a better way of letting users print out the contents of forms for individual records in an application in which the forms are nested in navigation subforms?
It occurs to me that vba could create an instance of a stand-alone form and print it when a control is clicked in the nested form. Ideally, this might happen behind the scenes, without the form ever becoming visible. This would cut the work of making changes to forms in half. But how would it look in code? Are there reasons not to do this? Do you have any better ideas?

How to show datagrid in ms access forms

I have to create a ms access form which has a text box and a button. I want to retrieve multiple records from db and show all those rows in ms access Form on click of the button.is there a way to show multiple records on a ms access form something like a datagrid and once i retrieve those records I should be able to update them.Please let me know if there is a solution
Regards,
Ravi
It sounds like you are referring to a continuous form. Here are a few links on the subject.
http://www.blueclaw-db.com/access_continuous_form_subform.htm
http://www.mvps.org/access/forms/frm0024.htm
It is one of the main plus points of access and one which can be used to great affect. Failing that you can use the datagrid activeX control and populate it through code but that is a little more involved (still quite easy still)

Dynamically loading SubReport data in SSRS

This is in SSRS 2008.
I've created a report with a tablix, embedded in the tablix there is a subreport. This subreport contains a lot of information (and I mean a lot – it takes more than 45 sec to load it).
I don’t want to show it, or to be more precise – to process/load the data when the report initially runs. Note that I dont want to just not display it - because then all the data is still processed at initial load time.
Instead, I only want the subreport to be processed (and the data pulled down), individually, when I display it (e.g. clicking a + sign to toggle it, or any other option such as clicking an image/ link, while staying in the same report). I also don’t want to open the subreport in a different tab or something like that....
Does anyone know a solution? Maybe there is an onLoad method, dynamic subreport or something like that?
I tried looking into the DataElementOutput attribute, but that's readOnly... anything else?
Before you jump through a lot of hoops to implement a workaround, have you analyzed the execution plan for the query which is delivers the data for the subreport? If you haven't, it's worth it to see if performance can be improved by adding a covering index which will help the query optimizer to deliver the data quickly.
Hope this helps,
Bill
So, as it turns out, the problem was in fact because I had the subreport repeated for each row in the parent report. Thus, the subreport was called numerous times...
And according to MS, there is no way to dynamically process individual subreports. Had to solve this issue by splitting out the subreport (at least the data-heavy parts) to a seperate page. :(