As long as the form is still open, the controls should be available.
Unfortunately, I don't have any experience with referring to form controls
from a report; perhaps someone else does and can jump in here. One thing you
might try is to change it to look something like this:
=DLookUp("[RequirementDescription]","[GBDRequirementsTbl]","[ReqNum] = " &
Forms!TestMatrixFrm![RequirementNumbertxt])
In other words, concatenate the value from the form onto the string. I can't
guarantee this will work, however. Sorry I can't be of more help.
Carl Rapson
"Linda" <(E-Mail Removed)> wrote in message
news:84A5F699-BDB2-44D3-8C51-(E-Mail Removed)...
> You are right in that the DLookup calls refer to a control on the form.
> In
> reading one of the other threads they said the form controls would be
> available to the report launched from the form. Here is an example of one
> of
> my DLookup calls:
> =DLookUp("[RequirementDescription]","[GBDRequirementsTbl]","[ReqNum] =
> Forms!TestMatrixFrm![RequirementNumbertxt]")
> --
> Linda
>
>
> "Carl Rapson" wrote:
>
>> "Linda" <(E-Mail Removed)> wrote in message
>> news:00C4C14A-1D4E-4216-8EC1-(E-Mail Removed)...
>> >I have a form that I have saved as a report. I would like to put a
>> >button
>> >on
>> > the form to print the report. How do I launch the report from the form
>> > button? There are some fields filled using DLookup on the form. They
>> > show
>> > up as #Error on the report. What might be causing that? Also, how can
>> > I
>> > limit the print to just the record the print report is selected in?
>> > Thanks
>> > in advance for any help you can provide.
>> > --
>> > Linda
>>
>> In the Click event of the button, call DoCmd.OpenReport:
>>
>> DoCmd.OpenReport "name you gave the report"
>>
>> To filter the report, specify the criteria in the WhereCondition
>> parameter
>> of the OpenReport call:
>>
>> DoCmd.OpenReport "name you gave the report",,,"[ID]=" & Me.ID
>>
>> The field you use for the criteria should be the primary key of the
>> record,
>> if possible. I used ID as a dummy field because I don't know the names of
>> your fields.
>>
>> I'm not sure about the problem with DLookUp. I've never saved a form as a
>> report; I always create reports directly from my tables and queries. My
>> guess would be that the DLookUp calls are referring to a control or field
>> that is on the form but not on the report. What do your DLookUp calls
>> look
>> like?
>>
>> Carl Rapson
>>
>>
>>
|