John W. Colby
jwcolby at colbyconsulting.com
Sat Mar 13 18:35:49 CST 2004
As for Objective 2, I think that someone who uses an Error System should pipe up and discuss how they see an error handler hooking in to the framework as they see it. I have always wanted to do an error handler of this type but... well... John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Robert Gracie Sent: Saturday, March 13, 2004 3:35 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Framework Discussion - Questions.. John, I have been messing around with your last db today, and I'm trying to stay with this. I have two questions/problems.. Objective/Question 1: How would you add a "dynamic sentence case" system that is specific to certain controls. For instance, I have a several forms, each form can have up to 45 text box and combos used to enter/display data. There are 6 different "types" of information stored. One type would be "Model and Serial Numbers", Another type would be Address..etc. Each requiring a different sentence case. Which is user selectable in the program settings for each of these 6 types. Currently I'm using a procedure, which among other things passes an integer for the "case type", along with the text from the control. Something like the below is placed on the OnExit event on each of the control I have programmed to be "case controlled" Example of Old Method: If bolMCaseY = True And Not IsNull(Me.Address1) = True Then Me![Address1] = ProperManager(Me![Address1], iMCaseChoice) End If I can't seem to figure out how to "instruct" the framework which controls are to be handled and which Case to use. I would love to get rid of all those procedure stubs in CBF. Objective/Question 2: I'm trying to add an error system to the framework. Basically I want to implement an error class that will extend the current err object with Logging, SMTP error reporting, etc.. Unless I'm doing something wrong, you can't dim the err object WithEvents, so that's out. I'm able to get the system to work in the form class directly, but that's it. I would like to pass the error control to the form passed into the form collection (and maybe into the control collection, and handle the errors there, but I simply keep running into dead ends.... I'm not even sure this can be done, or should be done. I think it would make for MUCH less coding though.... I'm sure I'm going about this all wrong.....:-( Option Compare Database Option Explicit Public fdclsFrm As dclsFrm Private Err As clsErrorSystem Private Sub Form_Open(Cancel As Integer) Set fdclsFrm = New dclsFrm Set Err = New clsErrorSystem Err.Init Me fdclsFrm.Init Me, Me With fdclsFrm.colClasses .item("cboCompany").clsDepObj.Add .item("cboEmployee"), cboEmployee.Name .item("cboCompany").clsDepObj.Add fdclsFrm, Me.Name .item("cboCompany").Requery End With End Sub Private Sub cmdClose_Click() Dim lng As Long On Error GoTo HandleErr Me.Caption = "some text" lng = "Sdf" ' causes an error 'DoCmd.Close ExitHere: Exit Sub HandleErr: Select Case Err.Number Case Else MsgBox Err.BuildError("frmpeopleV3.CmdClose") End Select End Sub Robert Gracie www.servicexp.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com