PDA

Click to See Complete Forum and Search --> : Visibility Based On Recordset Field


Justice4All
May 20th, 2004, 03:59 PM
Hi all,

I have a subform (child) in VBA where some information must remain anonymous to public users. My problem is that only the the code (which I've rewritten more ways than I can count) is not working:

Public Function doAnon()

If Me.Recordset.[Donor_Anon] = "Yes" Then
lblAnon.Visible = True
txtDonor.Visible = False
txtCredit.Visible = False
txtDate.Visible = False
Else
If Me.Recordset.[Donor_Anon] = "No" Then
lblAnon.Visible = False
txtDonor.Visible = True
txtCredit.Visible = True
txtDate.Visible = True
End If
End If
End Function

Extra Info...
Table name: Accession
Field Name: Donor_Anon
TextBox: txtDonorAnon

I called this function in the code for the parental command buttons (First, Previous, Next, and Last) directly under the doCmd... line and above the Exit_... line.

If anyone has ideas on how to get this running, I'd be very grateful. Thanks in advance to anyone who can help!!!