I have a form with an series of unbound textbox controls that I want to populate with field values from a foreign table. I am using Dlook up to retrieve the values. If there is a value, I want the checkbox next to the text box to be visible, otherwise it is not. The code works fine when the foreign table field value is not null. However, when the field is empty, I get a type mismatch error. Here is my code:
Code:
Private Sub Form_Load()On Error GoTo Err_Form_Load
DoCmd.GoToRecord , , acNewRec
Dim frm As Object
Set frm = Forms!New_Contact_Entry!Add_Contribution_SubForm.Form
frm.Text90.SetFocus
frm.Text90.Text = DLookup("[Restricted_Use_Custom1]", "Organization_Info")
If IsNull(frm.Text90.Value) = True Then
frm.Check1.Visible = False
End If
I've tried multiple permutations of the If statement but I have no luck. Setting a default value in the foreign table isn't working either.
Thanks