Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: let and get Properties .. Its been along time

    can anyone tell me what i doin rong? (beesides mai spellin) ?

    Dim port As Boolean
    Dim fund As Boolean

    Private Sub cboFund_BeforeUpdate(Cancel As Integer)
    If IsNull(Me.cboFund) Then
    EmptyCbo True, "fund"
    Else
    EmptyCbo False, "fund"
    End If
    End Sub
    Property Get fundSelected() As Boolean
    fundSelect = fund
    End Property
    Property Let EmptyCbo(tf As Boolean, portFund As String)
    Select Case portFund
    Case "port"
    port = tf
    Case "fund"
    fund = tf
    End Select
    MsgBox portFund & " is :" & tf
    End Property

    Private Sub cboPort_BeforeUpdate(Cancel As Integer)
    If IsNull(Me.cboFund) Then
    EmptyCbo True, "port"
    Else
    EmptyCbo False, "port"
    End If
    End Sub

  2. #2
    Join Date
    Jun 2004
    Posts
    96
    Property Get fundSelected() As Boolean
    fundSelected= fund
    End Property

  3. #3
    Join Date
    Oct 2003
    Posts
    311
    Quote Originally Posted by Cyherus
    Property Get fundSelected() As Boolean
    fundSelected= fund
    End Property
    Silly me!,, to many hrs!


    thanks!

  4. #4
    Join Date
    Oct 2003
    Posts
    311
    That isnt the only issue fundED

    i made the change and i get a msg like invalid use of property.


    I looked at the code and i have writen it as if the Get were a function and the let a sub,

    so i changed them from get - function and let to sub and it works.

    How am i doin this wrong?

  5. #5
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    I didn't see the word Public or Private in front of your Property Declartion. Also the Let Property must set the property. Here is an example of a functional Let Property:

    Code:
    Public Property Let MousePointer(ByVal New_MousePointer As MousePointerConstants)
    
    On Error GoTo ErrorHandler
    
    m_MousePointer = New_MousePointer
    PropertyChanged "MousePointer"
        
    Exit Property
    ErrorHandler:
    MainErrorHandler
    
    End Property
    Does that solve the issue?
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •