Re: Report Header



In the 3rd argument (criteria) of the DLookUp I posted:

"[DeptNo] = " & [DeptNoParam]

[DeptNo] is the Field name in the Table.

[DeptNoParam] is the name of the Parameter in the Query.

If both names are "DeptID", then change the criteria argument to:

"[DeptID] = " & [DeptID]

Access will recognise the first [DeptID] is supposed to be from the Table,
i.e. Field name and the second [DeptID] is a value external from the Table /
Domain "tblDepartment".

--
HTH
Van T. Dinh
MVP (Access)



"Karen" <Karen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DE33F89F-E940-4D8A-AD74-D8725786312D@xxxxxxxxxxxxxxxx
> Thank you for your help - I adjusted the titles accordingly and this is
> what
> I have.
>
> =DLookUp("DepartmentName","tblDepartment","[DeptID] = " & [DeptNoParam])
>
> Since this report references a parameter query as it's record source, the
> department that I enter in the intial parameter query dialog box (the
> query
> the report is based on) is the one the report recognizes. What would be
> the
> exact syntax for the header to elimiante the second parameter dialog box?
> I thought it would be:
> =DLookUp("DepartmentName","tblDepartment","[DeptID])
> but this is not working.
>
> Thank you, Karen
>
>
>
>
> "Van T. Dinh" wrote:
>
>> I guess the DeptNo uniquely determines the DeptName?
>>
>> If it does, you can create a calculated TextBox in the Report Header
>> using
>> the DLookUp() function in the ControlSource to get the DeptName, e.g. set
>> the ControlSource to something like:
>>
>> = DLookUp("DeptName", "tblDept", "[DeptNo] = " & [DeptNoParam])
>>
>> including the equal sign where [DeptNoParam] is the name of the Parameter
>> in
>> the Query.
>>
>> --
>> HTH
>> Van T. Dinh
>> MVP (Access)
>>
>>
>>
>> "Karen" <Karen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:545CE083-00FC-4DC0-8955-5CF3EE74A0B0@xxxxxxxxxxxxxxxx
>> >I have a report that references a parameter query as it's record source.
>> > When you click on the report, the parameter query dialog box opens and
>> > asks
>> > the user to enter the dept. number. The query works great, it
>> > populates
>> > the
>> > report accordingly. What info do I set as the header so the department
>> > name
>> > poplulates the report accordingly?
>> >
>> > Thank you, Karen
>>
>>
>>


.



Relevant Pages

  • Re: Report Header
    ... and try tp open the Report in the Preview mode. ... > Now it asks me for the department no. twice. ... >> In the 3rd argument of the DLookUp I posted: ... >>> Since this report references a parameter query as it's record source, ...
    (microsoft.public.access.reports)
  • Re: Questions on Control boxes, Parameter queries and calendars in
    ... >> created a report that is based on a parameter query. ... I would liek the agency box to be a drop down list so the ... I would like the parameter prompts for the beginning and ...
    (microsoft.public.access.reports)
  • Re: Drill Down to other detail
    ... My report is based on a parameter query, ... Can I use a parameter query with a form? ... Place the memo field, of the main form, below the subform. ...
    (microsoft.public.access.queries)
  • Re: Report Header
    ... Since this report references a parameter query as it's record source, ... >>I have a report that references a parameter query as it's record source. ...
    (microsoft.public.access.reports)
  • Re: Putting date range on report
    ... so does the report. ... source wasn't listed as my parameter query. ... Frank ... >source is not the same as the bracketed parameter text ...
    (microsoft.public.access.reports)