This code should go in the module or macro

Public Sub ShowForm4()

   Dim oRec As CRecord
   Set oRec = New CRecord
   oRec.Init REApplication.SessionContext
  
   oRec.Load 280
  
   UserForm4.ConstitID = oRec.Fields(RECORDS_fld_ID)
  
   UserForm4.Show
  
   oRec.CloseDown
   Set oRec = Nothing
  
End Sub



'The below code should go in the form
Private lID As Long

Public Property Get ConstitID() As Long
   ConstitID = lID
End Property

Public Property Let ConstitID(ByVal ID As Long)
   lID = ID
End Property

Private Sub UserForm_Activate()
  
   Dim oCon As CRecord
   Set oCon = New CRecord
   oCon.Init REApplication.SessionContext
  
   oCon.Load lID

   'This adds the constituent's name to a label on the form
   Label1.Caption = oCon.Fields(RECORDS_fld_FULL_NAME)

End Sub

Private Sub UserForm_Deactivate()

   oCon.CloseDown
   Set oCon = Nothing

End Sub

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Blackbaud Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.