[AccessD] Framework Discussion - Who's following this

John W. Colby jwcolby at colbyconsulting.com
Fri Mar 12 16:14:28 CST 2004


Ooooh I'm gonna have to work through that since I don't understand what you
are up to.  I'm assuming that we are talking interfaces here?

John W. Colby
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
DWUTKA at marlow.com
Sent: Friday, March 12, 2004 12:56 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Framework Discussion - Who's following this


1) Interest Level: Kind of (a).  I do a lot of ASP stuff, with VB .dll's in
the background.  Even though I am not dealing with 'bound forms', I am still
creating a project framework, that handles the 'transactions'.  Similar
concepts.

2) Understanding: Understand what you are doing just fine, so I guess that's
(a) again.

3) Participation: Not on the list.  So (e): reading the posts just to see if
you're doing something I haven't discovered myself. Basically, reading for
the sake of picking up new tips/tricks.

Something I'd like to ask, in an earlier post, you were explaining how you
were 'linking' your Class objects.  Just out of curiousity, why not do
something like this:

FrameWorkControl Class:
Option Compare Database
Property Set LinkedObject(objTemp As Object)

End Property
Public Function CleanUp()

End Function
Property Get ObjectName() As String

End Property
Property Get ObjectType() As String

End Property

FWComboBox Class:
Option Compare Database
Implements FrameWorkControl
Dim WithEvents lnkObject As ComboBox
Private Function FrameWorkControl_CleanUp() As Variant
Set lnkObject = Nothing
End Function
Private Property Set FrameWorkControl_LinkedObject(RHS As Object)
Set lnkObject = RHS
lnkObject.OnClick = "[Event Procedure]"
End Property
Private Property Get FrameWorkControl_ObjectName() As String
FrameWorkControl_ObjectName = lnkObject.Name
End Property
Private Property Get FrameWorkControl_ObjectType() As String
FrameWorkControl_ObjectType = "ComboBox"
End Property
Private Sub lnkObject_Click()
MsgBox lnkObject.Name
End Sub

FWTextBox Class:
Option Compare Database
Implements FrameWorkControl
Dim WithEvents lnkObject As TextBox
Private Function FrameWorkControl_CleanUp() As Variant
Set lnkObject = Nothing
End Function
Private Property Set FrameWorkControl_LinkedObject(RHS As Object)
Set lnkObject = RHS
lnkObject.OnClick = "[Event Procedure]"
End Property
Private Property Get FrameWorkControl_ObjectName() As String
FrameWorkControl_ObjectName = lnkObject.Name
End Property
Private Property Get FrameWorkControl_ObjectType() As String
FrameWorkControl_ObjectType = "TextBox"
End Property
Private Sub lnkObject_Click()
MsgBox lnkObject.Name
End Sub

Example Form Code:
Dim FrameWorkObjects As Collection
Private Sub Form_Load()
Dim FWObj As FrameWorkControl
Dim ctrl As Control
Dim blValidControl As Boolean
Set FrameWorkObjects = New Collection
For Each ctrl In Me.Controls
    blValidControl = False
    If TypeOf ctrl Is TextBox Then
        Set FWObj = New FWTextBox
        blValidControl = True
    End If
    If TypeOf ctrl Is ComboBox Then
        Set FWObj = New FWComboBox
        blValidControl = True
    End If
    If blValidControl Then
        Set FWObj.LinkedObject = ctrl
        FrameWorkObjects.Add FWObj, FWObj.ObjectName
        Set FWObj = Nothing
    End If
Next
End Sub
--
_______________________________________________
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