Reporting in MS Access - 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.

Related

Can VBA be used to change the sort order of the Microsoft Access Navigation Pane..?

Does the Microsoft Access 2007 Navigation Pane have a simple .Sort property that can be accessed by VBA..?
I would like to add some AutoExec code to a database which explicitly sets the NavPane to sort by name each time a user opens it.
I understand changing the NavPane system tables is a big can of worms, but I was wondering if something as simple as the sorting could be changed through an object property somewhere.
MS has an alternative approach which could basically be described as "roll your own replacement navigation page". Links to their information are on https://support.office.com/en-us/article/customize-the-navigation-pane-ccfb0ee7-d72f-4923-b4fb-ed6c15484244. I have not yet tried to follow their instructions, so I cannot report on how easy, difficult or effective this is.

How to capture form or report changes made in design view

I want to have an audit log of any change made to a form or report in design view, with the control or object manipulated, when it was done and by whom.
However, in creating this, I am stumped on the very first and most basic task, which is figuring out whether Access has a central function that would record the event of calling up a form in design view. [Hence I have no code to show for this problem yet].
What event or procedure in MS Access can I monitor (using VBA) to record when a form or report is called up in design view?
Any pointer provided is appreciated. Or alternatively if someone can tell me with certainty that this is not feasible to implement.
I can tell you with certainty that this is not possible. There is no such event.
The only thing available is the "Last modified" date, which you can read e.g. from MSysObjects.DateUpdate.
To track design changes, you may want to look here:
How do you use version control with Access development?

Options to Deploy MS Access Database Application for Data Collection

I am building an Access Database application in MS Access 2007 which is essentially a tool for data collection which I will need to distribute to various sites to be filled out. After the sites fill out all the necessary records, they will return the tool and I will need to merge all the data from the various sites into a single database for analysis. I have 2 tables and 3 forms with a bunch of custom VBA code behind for data validation, cleaning and flow.
I have a Summary form that shows all the records currently entered. Users can then Add a record using a button on the Summary form which launches a data entry form (let's call it Data Entry Form #1). From Data Entry Form #1, there is another form that can be launched (Data Entry Form #2) for entering child records about the record being filled out on Data Entry Form #1. There is referential integrity enforced at the table level.
The flow from the Summary Form to Data Entry Form #1 and Data Entry Form #2 is important for the integrity of the data. I have dictated this flow explicitly in VBA and will instruct users to always begin at the Summary Form.
After that lengthy background, my question.....
What are my different options, and the relative advantages/disadvantages for the options for deploying this application to my various sites. My basic requirements are:
Ideally users would never see the tables in which the data is being stored in.
The Summary form would launch when opened and they could not open any other form directly.
Closing the Summary form would close the application.
Since there is a bunch of VBA code dictating important functionality, if they did not accept the Security Warning, they would not be able to access any of the forms or use the tool
I can easily script the extraction/export of the data from the two tables for each tool
I am vaguely aware of the following options:
- Distribute the full ACCDB file to the sites
- Create and distribute an AACDE file to the sites
- Use the Access Developer Extensions to "package" the application - create and EXE file?
I have also read that if users do not have Access 2007 or later, that they can download the MS Access Runtime Services and be able to use my application without having to buy/install a full version of MS Access. Can someone confirm this? Does this apply to all of the above (ACCDB, ACCDE, EXE) Is there any functionality that would not be available to them from a strictly data entry role?
Thanks!
You should be able to do most of this with options set within access, plus some code;
Create an accde;
Using that accde, in the options, untick display navigation pane (or something like that); There should be an option to disable the shift key as well.
Set startform to the summary form
Closing the summary form closes the application: In design view of the summary form (in the accdb, before you do the rest of this), create a form_unload event; In this event put
DoCmd.Quit
More of an issue might be whether or not all the sites have the necessary components of ms office to run access 2007, or if you need to provide an access 2007 runtime as well, but I'm not going there. If you need to do this, you'd best ask another question or go hunting for an existing answer.
Hope this helps
If you do want to package the database as a run-time, the MS tools are notoriously flaky when it comes to deploying. A company called SageKey sell scripts that actually work, dealing with the issue of other versions of Access being installed, and many other things.
I've used about three versions of their scripts (ie. for three different MS Access versions), and they have been great.

Where can I edit existing queries defined in Access 2007?

I'm having to do some maintenance on a Access 2007 application. I've never really used it before so I'm struggling to figure out where things are hidden. This application is broken up into two ACCDB's - one for the application, one with the data. Inside of the application I am attempting to track down where various queries are defined but not having much luck.
I've looked in the data ACCDB and selected the "Queries" category off the sidebar. The queries are not there. Inside of the Visual Basic editor of the application ACCDB, they also don't appear in the "Microsoft Office Access Class Objects".
If I click on "Create", then Query Design it seems to open a designer where I can select these queries. However, I still can't seem to figure out how to actually edit existing ones (which is what I really want to do).
Where on earth can I edit them?
On the sidebar on the left you can select different categories like Tables, Queries etc.; however, queries can also be stored in the RecordSource of Forms, Reports and the RowSource of controls. For instance ListBox and ComboBox have a RowSource property. Queries can be stored as SQL strings in VBA code or Macros or they can even be created dynamically with VBA.

MS Access - Adding unbound fields at design time

I would like to create an Access report in which the record source is created via ADO code and then set as the record source for the report when the report is run. The problem I am running into is how to add fields to the report since the recordset is bound to the report at run-time and not design time. Is there way I can manually add the field and make sure the field name matches what will be provided in the recordset field collection? Thank you.
The standard solution to this problem is to add all your fields in design view, up to the max available, and hide all of them, and show only the ones you need. Michael Kaplan explained that when he designed the Access Replication Conflict Resolver, this is the approach he used, precisely because adding controls at runtime quickly uses the lifetime limit on the number of controls on a form (700+, but I can't recall the exact number).
It's also just a bad idea, as #Jeff O says, to do design changes at runtime. For one, it means you can never distribute an MDE.
Several ways to do it, but all of them have their issues. create-dynamic report using vba
Other questions have found the folley in working in design mode programatically.