expression that has no value error

odewallrus

New member
Local time
Today, 11:28
Joined
Dec 29, 2003
Messages
5
I am trying to hide a subform based on a value within that subform. This is working fine when selecting existing records, but fails when I try to add a new record. The error states, “You have entered an expression that has no value.” The value that I am checking is from a calculated query. Attached is an example, if there is anyone that has resolved a similar issue I would greatly appreciate a bit of assistance.
 

Attachments

Check to see if you have a NewRecord First:

Code:
Private Sub Form_Current()

    'Check for New Record
    If NewRecord = False Then
        If Forms!frmCustomer!subfrmPayment_Sum!You_Owe.Value = 0 Then
            Me.subfrmPayment_Sum.Visible = False
        Else
            Me.subfrmPayment_Sum.Visible = True
        End If
    Else
        'Obviously new record cannot owe anything just yet
        Me.subfrmPayment_Sum.Visible = False
    End If
    
End Sub
 
Travis, Works great! Thank you soo... very much. I am new at this and have been working at that issue for a while now.
 

Users who are viewing this thread

Back
Top Bottom