Tag Archives: access

XFDL in MS Access…

Just wanted to pass a link for the updated XFDL in MS Access Project.  Included in the zip are:

AccessXFDL – This folder has a working example of opening an XFDL form in access.  Does not work for all forms yet but will produce a form for most XFDLs.

libxfdl – This is the DLL made for an extension to VBA to take a part XFDL files and return a string of the data.

Here’s the link: http://dl.dropbox.com/u/18666533/AccessXFDL.zip

Enjoy!

VBA – User Defined Type

As much as I do not like VBA, I do like the “User Defined Types” which, from a C/C++ programmer’s prospective, this is a lot like using structs.  And for data management, which is probably 90% of what VBA is used for, it makes a lot of since.  How do we define a User Defined Type?

Private Type dict
    a As Integer
    b As String
    c As String
    d As Integer
End Type

Once Defined, we need an initialization function to store the struct.

Private Function defineDict() As dict
    defineDict.a = 1
    defineDict.b = "two"
    defineDict.c = "three"
    defineDict.d = 4
End Function

At this point, we can use the same calling to to that ‘struct’ to change the variables as needed.

Sub testType()
    Dim t As dict       ' Set the variable
    t = defineDict      ' Initialize
    Debug.Print t.b     ' Prints >> "two"
    t.b = "no more"     ' Change a variable
    Debug.Print t.b     ' Prints >> "no more"
End Sub