Problem with Property-Object Type-Property 
Author Message
 Problem with Property-Object Type-Property

I think i have a problem with the property-object property Type, Access 97
with service pack 2 instaled after
service pack 1.
I'm determining the .Name, .Value and .Type for each property in or
The name for .Type is set by comparence between its value and the build in
constants for settings and
resultvalues for Field-, Parameter- of Property-objects. I'm left confiused
by the results. See them
at the bottom of this message.

I'm working on this code for automatic recreating an object in an access
database that in one or the other
way doesn't function as it should be after redesigning. (For instance refers
to a control source that isn't
in the recordsource and isn't in any control that exist and many more.)

The information retrieved by the code is stored in an table. The table is
used for recreation.

Option Compare Database
Option Explicit
Option Base 1

    Dim IPEStr As String
    Dim IPEItemName As String
    Dim dbObjsMatrix() As String


Private Sub Eigenschappen_Click()

On Error GoTo EigenschappenError

    Const objTabelProloog As String = "ObjDef"

    Dim Bron As String
    Dim BronNr As Long
    Dim CodeRegelTeller As Long
    Dim ctl As Control
    Dim ctlId As Long
    Dim dbs As Database
    Dim fld As Field
    Dim GroupLevelTeller As Byte
    Dim grpl As GroupLevel
    Dim IdTeller As Long
    Dim mdl As Module
    Dim msg As String
    Dim obj As Object
    Dim objId As Long
    Dim objNaam As String
    Dim objType As String
    Dim Prp As Property
    Dim rstObjDef As Recordset
    Dim sctn As Section
    Dim SectieTeller As Integer
    Dim Tabelnaam As String
    Dim tdf As TableDef

    Case "Form"
        DoCmd.OpenForm (objNaam), acDesign, , , , acHidden
        Set obj = Forms(objNaam)
    Case "Report"
        DoCmd.OpenReport (objNaam), acViewDesign
        Set obj = Reports(objNaam)
        Select Case objType
        Case "Form", "Report"
            On Error GoTo ItemPropertiesError
            For Each Prp In obj.Properties
                IPEStr = ""
                IPEItemName = Prp.Name
                !ID = IdTeller
                !ParentId = objId
                !ObjectType = "Property"
                !Name = Prp.Name
                If Not IsNull(Prp.Value) Then !Extra1 = CStr(Prp.Value)
                'If Not IsNull(Prp.Type) Then !Extra2 = CStr(Prp.Type)
<!!!!! Value as string>
                If Not IsNull(Prp.Type) Then !Extra2 =
prpOmschrijving(Prp.Type)     <!!!!! Converted>
                !ErrorBericht = IPEStr
                IdTeller = IdTeller + 1
            Next Prp
            On Error GoTo EigenschappenError
        End Select

End Sub


Private Function prpOmschrijving(prpType As Long) As String

    Select Case prpType
    Case dbBigInt
        prpOmschrijving = "Big Integer"
    Case dbBinary
        prpOmschrijving = "Binary"
    Case dbBoolean
        prpOmschrijving = "Boolean"
    Case dbByte
        prpOmschrijving = "Byte"
    Case dbChar
        prpOmschrijving = "Char"
    Case dbCurrency
        prpOmschrijving = "Currency"
    Case dbDate
        prpOmschrijving = "Date / Time"
    Case dbDecimal
        prpOmschrijving = "Decimal"
    Case dbDouble
        prpOmschrijving = "Double"
    Case dbFloat
        prpOmschrijving = "Float"
    Case dbGUID
        prpOmschrijving = "Guid"
    Case dbInteger
        prpOmschrijving = "Integer"
    Case dbLong
        prpOmschrijving = "Long"
    Case dbLongBinary
        prpOmschrijving = "Long Binary (OLE Object)"
    Case dbMemo
        prpOmschrijving = "Memo"
    Case dbNumeric
        prpOmschrijving = "Numeric"
    Case dbSingle
        prpOmschrijving = "Single"
    Case dbText
        prpOmschrijving = "Text"
    Case dbTime
        prpOmschrijving = "Time"
    Case dbTimeStamp
        prpOmschrijving = "Time Stamp"
    Case dbVarBinary
        prpOmschrijving = "VarBinary"
    Case Else
        prpOmschrijving = "Type instelling of resultaatwaarde voor een
Field-, Parameter- of Property-object komt niet voor in Access-lijst"
    End Select

End Function

In this case the following line of code is commented out:
'If Not IsNull(Prp.Type) Then !Extra2 = CStr(Prp.Type)
Resulting in the following table:

226;1;"Property";"RecordSource";"Rechnung";"Date / Time";;""
mer])";"Date / Time";;""
228;1;"Property";"FilterOn";"Onwaar";"Long Binary (OLE Object)";;""
229;1;"Property";"OrderBy";"";"Date / Time";;""
230;1;"Property";"OrderByOn";"Onwaar";"Long Binary (OLE Object)";;""
231;1;"Property";"Caption";"";"Date / Time";;""
237;1;"Property";"MinButton";"Waar";"Long Binary (OLE Object)";;""
238;1;"Property";"MaxButton";"Waar";"Long Binary (OLE Object)";;""

In this case the following line of code is commented out:
'If Not IsNull(Prp.Type) Then !Extra2 = prpOmschrijving(Prp.Type)
Resulting in the following table:


Property RecordSource, Value="Rechnung", Type=8 or "Date / Time" ???
property OrderByOn, Value="Onwaar", Type=11 or "Long Binary (OLE Object)"
??? <Dutch "Onwaar" = English "False>
Property Width, Value=10319, Type=2 or Byte ???

Shouldend it be  RecordSource.Type = Text?
Shouldend it be  OrderByOn.Type = Boolean?
Shouldend it be  Width.Type = Integer or Long?

Hopefully somebody knows what is going on

Greetings, Niels Leeflang.

Mon, 16 Dec 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Object Properties don't see in properties Window

2. Object Properties, Array Properties

3. .property vs. question

4. Property-object Value-property and Type-property seems to mismatch.

5. User-defined types as properties of objects?

6. Properties of a object type

7. User defined type for object properties

8. Obtaining properties types from any given object

9. Properties of object type

10. Obvous type error: Object doesn't support this property or method

11. Obtaining properties types from any given object

12. problem with property set in Properties Window


Powered by phpBB® Forum Software