[AccessD] Set value in a report textbox
Stuart McLachlan
stuart at lexacorp.com.pg
Tue Oct 30 18:02:52 CDT 2018
Several ways:
1. DLookup("PE_Fname,"tblPeople", "PE_Fam-spot = 'A' AND "PE_IDHH = " & HH_ID )
2. Join a new qryHHPrimaryFName to your current query on PE_IDHH = DD_ID where
qryHHPrimaryFName is:
SELECT PE_Fname FROM tblPeople WHERE PE_IDHH = "A"
3. A function:
FUNCTION HHHeadFName(HHID as long) AS STRING
HHHeadFName =DLookup("PE_Fname,"tblPeople", "PE_Fam-spot = 'A' AND
"PE_IDHH = " & HH_ID )
END FUNCTION
On 30 Oct 2018 at 17:04, Tina N Fields wrote:
> Hii,
>
> I have a report for my local Salvation Army, that is to be a signature
> sheet for the family picking up the Christmas stuff.
>
> When we developed it, they wanted only the household name and the
> assigned family number to be displayed at the top of the report. Turns
> out, though, they'd really also like the first name of the parent of
> the household.
>
> The tblHouseholds doesn't have any person names in it, of course.
> So, I want to put a textbox alongside the Household name box to be
> populated with the first name of person A in the household. The
> tblPeople has the foreign key matching the household ID. (Using John
> Colby's naming convention, HH_ID from tblHouseholds is foreign key
> PE_IDHH.)
>
> How do I do this? I have the PE_Fname in the query, and I have the
> person's rank in the family (they insisted on this), so each
> individual's record has a PE_Fam-spot field. How do I display the
> PE_Fname of the person with the PE_Fam-spot of "A" where PE_IDHH
> equals HH_ID?
>
> It feels as though this should be simple, but I'm just not getting it.
>
> Thanks for any help you can give me.
>
> T
>
> --
> Tina Norris Fields
> 231-322-2787
> tinanfields-at-torchlake-dot-com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
More information about the AccessD
mailing list