[AccessD] Error Traps - Question for Colby

Jim Lawrence accessd at shaw.ca
Sun May 12 12:33:00 CDT 2013


Hi Rocky:

There has to be a With statement with the select components or it wouldn't
work. There must be a few lines of code missing. I would suspect that a
variable would be passed without using the return statement. I use to use a
lot of 'types' as they were great for passing a mixed groups of
variables...when only returning a single variable a return statement is just
fine. 

Note: that this is air code

Example:

Option Explicit

Public Type Main_Error_type
    strProcKind as String
    lngProcKind as long
    ...	
End Type

Public Function HandleErrorCode() as string
    Dim Error_type As Main_Error_type

    'GET THE STRING THAT REPRESENTS THE PROCEDURE TYPE
    With Error_type
        Select Case .lngProcKind
        Case vbext_pk_Get
            .strProcKind = "Get"
        Case vbext_pk_Let
            .strProcKind = "Let"
        Case vbext_pk_Set
            .strProcKind = "Set"
        Case vbext_pk_Proc
            If InStr(.strProcDecl, "Sub") = 0 Then
                .strProcKind = "Function"
            Else
                .strProcKind = "Sub"
            End If
        Case Else
        End Select
    End with

    ...

End Function

Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Sunday, May 12, 2013 9:03 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Error Traps - Question for Colby

P.S.  If I comment out all the lines in the Select Case the app compiles OK.

R
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: May 12, 2013 8:36 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Error Traps - Question for Colby

JC:
 
I'm using your error module builder to put error traps into an app for a
client.  I haven't used it for years but it always worked in the past.  Now
I'm getting a compile error in this new app
 
Compile error variable not defined.  and vbext_pk_Getis highlighted in

 
'GET THE STRING THAT REPRESENTS THE PROCEDURE TYPE
        Select Case .lngProcKind
        Case vbext_pk_Get
            .strProcKind = "Get"
        Case vbext_pk_Let
            .strProcKind = "Let"
        Case vbext_pk_Set
            .strProcKind = "Set"
        Case vbext_pk_Proc
            If InStr(.strProcDecl, "Sub") = 0 Then
                .strProcKind = "Function"
            Else
                .strProcKind = "Sub"
            End If
        Case Else
        End Select

But I can't find any other reference to vbext_pk_Get even in an old app
where the code works and compiles correctly.
 
Do yo know what might be the problem?
 
Thanks and regards,
 
Rocky Smolin
Beach Access Software
858-259-4334
www.bchacc.com <http://www.bchacc.com/> www.e-z-mrp.com
<http://www.e-z-mrp.com/>
Skype: rocky.smolin
 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
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