Subform not hiding

rbriedis

New member
Local time
Today, 13:54
Joined
Dec 8, 2014
Messages
3
Hello all,
I hope you can help. I am probably missing something obvious but for some reason, I cant get my subform to hide. :banghead::banghead:

Main form is called 'frm_main_add' and the subform is called 'tbl_transaction_subform'.

I am rying to get it to hide the subform (tbl_transaction_subform) if a field in the main form(frm_main_add) is null but its doing nothing.....

I put this code in the 'on current' and 'on load' in the frm_main_add and nothing......
If (Expense_Name = Null) Then tbl_transaction_subform.Visible = False Else tbl_transaction_subform.Visible = True

I attached a small snippet of the screen for your reference.
 

Attachments

  • Untitled.png
    Untitled.png
    23.2 KB · Views: 167
Nothing ever equals Null . . .
Code:
If Something = Null Then
[COLOR="Green"]    'this code will never run
    'nothing ever equals Null
[/COLOR]    MsgBox "Made it here"
End If
. . . not even Null. Try this in the immediate pane . . .
Code:
? null = null
It does not return True. Use the VBA IsNull() function, or the Access Nz() function to handle Nulls.
 

Users who are viewing this thread

Back
Top Bottom