document my database
April 27, 2008 6:58 PM
Subscribe
I have a particular propriety database application that has a great feature for users to document notes and changes to the db. Annotated screenshot
here.
Basically, you click on the little yellow sticky note and the documentation window pops up and users can enter notes about changes, etc. Its so useful I would like to use it all the time.
I am now creating a database project that I would like to recreate this documentation feature. I figured out the database structure for this by some creative sleuthing, but I am having trouble how how to link the documentation record to the particular field (and record) that it is documenting. For instance if I have a field in the table, Field1, and I have a button to pop up the documentation window next to that field, how do I automatically insert data into a 'reference field' into the documentation table that says this comes from Field1? I guess I can change the value of some variable and then automatically fill the field when data is entered into the documentation form.
Problem is, I am having trouble doing this in MS Access. Any ideas?
posted by buttercup to computers & internet (3 comments total)
1 user marked this as a favorite
id (unique identifier for the note, autoincrement, PK)
parentid (unique identifier of the main record, FK)
dt (timestamp of when the note was added, now() function could autofill it)
originatingColumn (column name)
content (text storage for the actual note)
author
Can only speak in generalities, without seeing the ERD of your database of course. I've make the assumption you're only documenting one table. I suppose you could add an originatingTable column to extend that over a whole application.
So your query to view the information for a particular column of a particular record would be something like:
SELECT * FROM documentation
WHERE parentid = [[Current Record]]
AND originatingColumn = [[Current Column]]
ORDER BY dt DESC;
Where [[ ]] are variables you would have to grab values for before running the query.
posted by Static Vagabond at 8:05 PM on April 27, 2008