Solved

Ms Access Query Question

Posted on 2014-01-14
2
272 Views
Last Modified: 2014-01-16
I have a home business that I run by myself and use Microsoft Access to manage my customers, inventory, shipments, vendors etc. The database is constantly evolving with my business and has accumulated many tables, forms, reports, etc. over the past 15 years. To better manage my database I created a query with the following SQL.

SELECT * FROM MSysObjects WHERE Flags=0

This query gives me a list of all the objects so I can review them. I would like to add one additional field called the Description field so that I can make notes to remind me what each of these objects does. I think that I need to add a separate table with the description field and perhaps one other field used to link the two tables together. What is the best way to link the tables and create a safeguard so that I cannot accidentally modify any of the data in the system's table but still be able to update the description field in my description table. (I'm aware that I can view the properties of objects and add comments but a table view will make it much easier). I'm using Access 2010.
0
Comment
Question by:EclecticBob
2 Comments
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39780818
Since you can't update the system table, you won't be able to update anything in a query that joins the system table to another table.

Access does provide a Description field but it doesn't show it in the MSysObjects table.  It also only shows it in the nav pane if you use the show Details option.

You can "see" the Description field if you use the tables collection to view the data.  This will require some code which I don't have handy.  If you do a google search for Access database container, you should get a sample replacement for the nav pain (sic) that looks like the database container from earlier versions of Access.  This link should get you started - http://www.accessjunkie.com/Pages/faq_13.aspx .  It doesn't include the Description so you would need to modify it.  Then you have the task of making the form update the description.

A less code intensive solution would be to create your own version of MSysObjects that includes the Description field.  Define a primary key for this table that will eliminate duplicates.  If you always use prefixes for objects, then the object name would work.  Otherwise, you'll need at least two columns.

Then periodically, run an append query that appends new objects to your personal table.  Duplicates will be ignored so don't worry about trying to filter out what you already have.  The downside to this is it will get out of sync if you change the names of objects.  The upside, you can do it with just the append query and a form and no code.
0
 

Author Closing Comment

by:EclecticBob
ID: 39785990
Thank you, I took your suggestion and created a separate table of MSysObjects which I will periodically update. Seems like the best solution.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now