|
-
Sep 22nd, 2008, 08:32 AM
#1
Thread Starter
Fanatic Member
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,
-
Sep 23rd, 2008, 07:39 AM
#2
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|