[AccessD] Framework Discussion - Questions..

Robert Gracie Subscriptions at servicexp.com
Sat Mar 13 14:34:57 CST 2004


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






More information about the AccessD mailing list