Results 1 to 2 of 2

Thread: Problems with passing stuff

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    5

    Question

    Hi
    I am creating a program that uses class modules to access a database. All the procudures that access the database are in a class module.
    Whenever I am retrieving records from the database I am first checking to see if there are any by using..

    if rs.eof = true and rs.bof = true then
    exit sub
    end if

    ..I want to maybe use a flag that is set in this class module when there are no records. How can I get my form to recognise this flag?

    Any help would be appreciated

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    You simply set up a private variable with the appropriate Let and Get procedures and then set it using the . operator

    i.e., in the class (e.g. MyClass)
    Code:
    Private m_NoRecordsFlag As Boolean
    
    
    Public Property Get NoRecordsFlag() As Boolean
    
    NoRecordsFlag = m_NoRecordsFlag
    
    End Property
    
    
    Public Property Let NoRecordsFlag(ByVal bNewFlagValue As Boolean)
    
    m_NoRecordsFlag = bNewFlagValue
    
    End Property
    And in your form you would have:

    Code:
    Dim o_MyClass As MyClass
    Set o_MyClass = New MyClass
    
    If rs.EOF = True and rs.BOF = True Then 
      o_MyClass.NoRecordsFlag = True
      Exit Sub 
    Else
      o_MyClass.NoRecordsFlag = False  
    End If
    P.


    Not nearly so tired now...

    Haven't been around much so be gentle...

Posting Permissions

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



Click Here to Expand Forum to Full Width