We are a group of users of Blackbaud products and are not affiliated with Blackbaud. We'd love to have you join our community to help and be helped in getting the most from your Blackbaud software.
Register now to join us to get independant advice on your system, connect with 3rd party consultants to help you maximize your database and have a real alternative to the official Blackbaud website.
I am trying to populate a combo box with "donor" and "TFRS" and when the user clicks on one of them it sets the constituent code to whatever option they chose. I need to make sure the code doesn't already exist though. Here is my code thus far. Any idea where I'm going wrong.
Dim oconstituent As CRecord
Dim oconstit As New CConstituentForm
Dim oconstits As CConstituentCode
'This procedure will be called each time a record of the specified type is closed
Public Sub Gift_CloseRecord()
If oconstits.Fields(CONSTITUENT_CODE_fld_CODE) <> "DONOR" Then
UserForm1.ActiveControl.SetFocus
UserForm1.ComboBox1.AddItem ("DONOR, 0")
UserForm1.ComboBox1.AddItem ("TFRS, 1")
End If
If UserForm1.ComboBox1.ListIndex = 0 Then
oconstits.Fields(CONSTITUENT_CODE_fld_CODE) = "DONOR"
Else
If UserForm1.ComboBox1.ListIndex = 1 Then
oconstits.Fields(CONSTITUENT_CODE_fld_CODE) = "TFRS"
Else
End If
End If
Exit Sub
End Sub