[AccessD] ...building, managing, and using a page favorites list

William Hindman wdhindman at dejpolsystems.com
Sun Mar 8 22:25:46 CDT 2009


...lol ...you live to make my life difficult :)
1) bound fields in a badge issuing system designed to be as fast as possible
...every record update/add has the time and user recorded in the record 
itself ...I don't use the add/insert function in the basAudit for anything 
at the moment.
...the audit changes functionality was added when we needed to know which 
user was generating bad data ...it worked.
...there is no delete functionality ...if a mistake is made, the user 
cancels the print and corrects the badge data ...no deletes are allowed 
...if a mistake is made, the user puts it in the record notes field and 
moves on ...it is corrected after the show by users who know what they are 
doing ...I never let the temp worker at the show do anything that is 
irreversible.
2) the table that the data comes from is in Const txtTableName at the top of 
the form code, no query, no SQL ...its a table produced from the main mdb 
before the show ...I fully grant you that it isn't an everyday solution but 
it sure keeps me from putting the real data at the mercy of temp hires 
...now if you have a better idea for applying this to the real world, I'm 
all ears :)
3) granted, but its not :) ...any class resolution should provide the 
functionality for me to id controls that are not to be audited ...for 
instance, I sure as hell don't intend to audit memo fields or fields that 
are concatenations :)
4) granted ...which is why I audit only those records/fields that are 
critical ...no one promised you a rose garden :)
...but if you have a better solution, like I said, I'm all ears :)

William

--------------------------------------------------
From: "jwcolby" <jwcolby at colbyconsulting.com>
Sent: Sunday, March 08, 2009 9:04 PM
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] ...building, managing, and using a page favorites 
list

> Other problems I see:
>
> 1) The AuditTable needs an "Edit type" field.  We need to know whether the 
> data in the table was an
> edit to the field, a new record, or a delete.
> 2) The table that the data comes from... how do I determine that?  Am I 
> drilling down into the DAO
> under the control?  What happens if this is a complex query?  Even worse a 
> complex SQL statement?
> 3) The field name can be determined from the control source, but it may be 
> an alias if the form's
> recordsource is a query or SQL Statement.
> 4) Recording full on text fields for the table name, field name and 
> computer name is going to be
> very expensive.  If you have a form with 40 fields and you are performing 
> an add record...
>
> John W. Colby
> www.ColbyConsulting.com
>
>
> William Hindman wrote:
>> ...you're a mite touchy these days :)
>>
>> tblAudit
>> ID
>> MachineName
>> User
>> TableName
>> RecordPrimaryKey
>> FieldName
>> OriginalValue
>> NewValue
>> dateTimeStamp
>>
>> basAudit
>> Option Compare Database
>> Option Explicit
>>
>> Sub WriteAuditUpdate(txtTableName, lngRecordNum, txtFieldName, OrgValue,
>> CurValue)
>> Dim db As DAO.Database
>> Dim rs As DAO.Recordset
>> Set db = CurrentDb
>> Set rs = db.OpenRecordset("AuditTable")
>>
>>     rs.AddNew
>>     rs!TableName = txtTableName
>>     rs!RecordPrimaryKey = lngRecordNum
>>     rs!FieldName = txtFieldName
>>     rs!MachineName = ComputerName
>>     rs!User = UserID
>>     rs!OriginalValue = OrgValue
>>     rs!NewValue = CurValue
>>     rs!DateTimeStamp = Now()
>>     rs.Update
>> rs.Close
>> db.Close
>> End Sub
>>
>> Sub WriteAuditAddDelete(txtTableName, lngRecordNum, txtFieldName, 
>> OrgValue,
>> CurValue)
>> Dim db As DAO.Database
>> Dim rs As DAO.Recordset
>> Set db = CurrentDb
>> Set rs = db.OpenRecordset("AuditTable")
>>
>>     rs.AddNew
>>     rs!TableName = txtTableName
>>     rs!RecordPrimaryKey = lngRecordNum
>>     rs!MachineName = ComputerName
>>     rs!User = UserID
>>     rs!NewValue = CurValue
>>     rs!DateTimeStamp = Now()
>>     rs.Update
>> rs.Close
>> db.Close
>> End Sub
>>
>> Typical Form cb
>>
>> Option Compare Database
>> Option Explicit
>>
>> Const txtTableName = "tblCompany"
>>
>> Private Sub cboCountry_BeforeUpdate(Cancel As Integer)
>> On Error GoTo Err_cboCountry_BeforeUpdate
>>
>>     WriteAuditUpdate txtTableName, Me.CompanyID, "cboCountry",
>> Me.cboCountry.OldValue, Me.cboCountry.Value
>>
>> Exit_cboCountry_BeforeUpdate:
>>     Exit Sub
>>
>> Err_cboCountry_BeforeUpdate:
>>     MsgBox "Error # " & Str(Err.Number) & " was generated by " & 
>> Err.Source
>> & Chr(13) & Err.Description
>>     Resume Exit_cboCountry_BeforeUpdate
>>
>> End Sub
>>
>> William
>>
>> --------------------------------------------------
>> From: "jwcolby" <jwcolby at colbyconsulting.com>
>> Sent: Saturday, March 07, 2009 10:21 PM
>> To: "Access Developers discussion and problem solving"
>> <accessd at databaseadvisors.com>
>> Subject: Re: [AccessD] ...building, managing, and using a page favorites
>> list
>>
>>> I provided code for automatically iterating the controls collection.  I
>>> provided classes for two of
>>> the data aware controls.
>>>
>>> What is your code for the audit trail, writing the old values to the 
>>> audit
>>> table?  I haven't done
>>> that but if you have, it should be trivial to add it to the form class.
>>>
>>> John W. Colby
>>> www.ColbyConsulting.com
>>>
>>>
>>> William Hindman wrote:
>>>> ...I don't NEED classes for anything ...anything except pain avoidance 
>>>> in
>>>> doing the same thing over and over
>>>> ...yes I can iterate the forms and have ...but then I add a new control
>>>> and
>>>> have to remember to do it again
>>>> ...classes SHOULD put that into the auto category ...but like you, I'm
>>>> waiting on the conductor :)
>>>>
>>>> William
>>>>
>>>> --------------------------------------------------
>>>> From: "Max Wanadoo" <max.wanadoo at gmail.com>
>>>> Sent: Saturday, March 07, 2009 6:33 PM
>>>> To: "'Access Developers discussion and problem solving'"
>>>> <accessd at databaseadvisors.com>
>>>> Subject: Re: [AccessD] ...building, managing, and using a page 
>>>> favorites
>>>> list
>>>>
>>>>> You don't need classes for that.  Just a global Boolean and one line 
>>>>> of
>>>>> code
>>>>> on entry to function/sub and one when you leave function/sub.
>>>>>
>>>>> On Entry
>>>>> If bgLogMe then call pfLogEntry(me,True)
>>>>>
>>>>> On exit
>>>>> If bgLogMe then call pfLogEntry(me,False)
>>>>>
>>>>> It would be a simple matter to write some code to run though all 
>>>>> modules
>>>>> and
>>>>> insert that line of code.
>>>>>
>>>>> As I said to JWC, I do (sometimes) use Classes but the real reason I
>>>>> don't
>>>>> is that I have never came across any situation where I NEED them.
>>>>>
>>>>> But, Like you, I am looking forward to the Missive (Don't know if I 
>>>>> will
>>>>> live that long though - he really is an arse-dragger).
>>>>>
>>>>> Max
>>>>>
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: accessd-bounces at databaseadvisors.com
>>>>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William
>>>>> Hindman
>>>>> Sent: 07 March 2009 23:25
>>>>> To: Access Developers discussion and problem solving
>>>>> Subject: Re: [AccessD] ...building, managing, and using a page 
>>>>> favorites
>>>>> list
>>>>>
>>>>> ...I do audit trail logging on key forms ...but the code I'm using
>>>>> requires
>>>>> that I mod every control in each form ...pita it is ...one of the 
>>>>> things
>>>>> I'm
>>>>>
>>>>> hoping to get from jc's class system is a way to automatically include
>>>>> that
>>>>> feature with the code in a single place.
>>>>> William
>>>>>
>>>>> --------------------------------------------------
>>>>> From: "Max Wanadoo" <max.wanadoo at gmail.com>
>>>>> Sent: Saturday, March 07, 2009 1:51 PM
>>>>> To: "'Access Developers discussion and problem solving'"
>>>>> <accessd at databaseadvisors.com>
>>>>> Subject: Re: [AccessD] ...building, managing, and using a page 
>>>>> favorites
>>>>> list
>>>>>
>>>>>> William,
>>>>>>
>>>>>> I do *something* similar but I put mine on hot keys, Ctl-M for Max's
>>>>>> Menu,
>>>>>> Ctl-xyz for others. The code within the loading checks the person who
>>>>>> has
>>>>>> logged in.  Generically I can allow the OnLoad code if the 
>>>>>> currentuser
>>>>>> has
>>>>>> an access level <= that required for this operation.
>>>>>>
>>>>>> Not in Treeview though, just normal forms.
>>>>>>
>>>>>> Also, all my Forms, Reports can be *logged* so that I can go back and
>>>>>> see
>>>>>> who done-what and when they done it.
>>>>>>
>>>>>>
>>>>>> HTH
>>>>>>
>>>>>> Max
>>>>>>
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: accessd-bounces at databaseadvisors.com
>>>>>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William
>>>>>> Hindman
>>>>>> Sent: 07 March 2009 17:47
>>>>>> To: Access Developers discussion and problem solving
>>>>>> Subject: [AccessD] ...building, managing, and using a page favorites
>>>>>> list
>>>>>>
>>>>>> ...I want to create a user specific favorites list for an a2k3 mdb fe
>>>>>> ...such that when joe blow is logged in, in addition to my normal
>>>>>> treeview
>>>>>> menu, he'll also see a mini menu with up to 5 page selects that he 
>>>>>> has
>>>>>> chosen and can go directly to with a single click.
>>>>>>
>>>>>> ...has anyone built something like this before ...any ideas, samples,
>>>>>> etc
>>>>>> much appreciated
>>>>>>
>>>>>> William
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> AccessD mailing list
>>>>>> AccessD at databaseadvisors.com
>>>>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>>>>> Website: http://www.databaseadvisors.com
>>>>>>
>>>>>> -- 
>>>>>> AccessD mailing list
>>>>>> AccessD at databaseadvisors.com
>>>>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>>>>> Website: http://www.databaseadvisors.com
>>>>>>
>>>>> -- 
>>>>> AccessD mailing list
>>>>> AccessD at databaseadvisors.com
>>>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>>>> Website: http://www.databaseadvisors.com
>>>>>
>>>>> -- 
>>>>> AccessD mailing list
>>>>> AccessD at databaseadvisors.com
>>>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>>>> Website: http://www.databaseadvisors.com
>>>>>
>>> -- 
>>> AccessD mailing list
>>> AccessD at databaseadvisors.com
>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>> Website: http://www.databaseadvisors.com
>>>
>>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list