ms access - show label if child doesn't exist
Hi,
i have a parent form with a child subform.
the forms connect using the personID, and subform displays the person special hobbies.
some persons don't have any special hobbies, and therefore don't have any records in the personsSpecialHobbies table.
currently this results in the subform being blanked out.
Q: how do i display in this situation a label inside the form saying "person doesn't have any special hobbies" (or similar solution).
Thanks,
Re: ms access - show label if child doesn't exist
hi,
I don't use sub forms so am taking a stab in the dark here,
I would asume that if the sub form is open then you have a form object
so you may be able to test the Key field using code
Code:
dim f as form
set f = forms("subFromNAme")
if is null(f.Keyfield ) then
lblNothingthere = "No Hobbies"
endif
set f = nothing
as i said i don't use sub forms so i may be wrong
Thanks
David