Another DLookup Q

  • Thread starter Thread starter S. Jackson
  • Start date Start date
S

S. Jackson

Okay - I give up. I tried using MS Help and the web - can't find an answer
for this:

I want Reports!rptCaseInfo to lookup the Hearing Start Date [Hrgstart] from
tblHearings where tblHearings[CaseId] = rptCaseInfo[CaseId]

I have this expression entered into a text box: =
DLookUp("[HrgStart]","[tblHearings]","[CaseId] = Reports![rptCaseStatus]")

Its not working - I'm getting a blank text box. Is this because the field I
am trying to lookup in tblHearings is a Date field?

Also, if I include tblHearings in the query I get an un-updateable record
set. But, since I want the query to generate a report, can I run it anyway,
just to get the report? This would solve my Dlookup problem, but are there
consequences if I do this?

S. Jackson
 
Okay - I give up. I tried using MS Help and the web - can't find an answer
for this:

I want Reports!rptCaseInfo to lookup the Hearing Start Date [Hrgstart] from
tblHearings where tblHearings[CaseId] = rptCaseInfo[CaseId]

I have this expression entered into a text box: =
DLookUp("[HrgStart]","[tblHearings]","[CaseId] = Reports![rptCaseStatus]")

Its not working - I'm getting a blank text box. Is this because the field I
am trying to lookup in tblHearings is a Date field?

No. It's because Access is searching the CaseID field for the name of
a report. There probably are no records where the CaseID is equal TO
AN ACCESS REPORT OBJECT!
Also, if I include tblHearings in the query I get an un-updateable record
set. But, since I want the query to generate a report, can I run it anyway,
just to get the report? This would solve my Dlookup problem, but are there
consequences if I do this?

Reports are TYPICALLY built upon queries, and there is no need for
those queries to be updateable. You don't need to "run" the query -
simply use it as the Recordsource for your report. By all means,
include tblHearings in the Report's recordsource query.
 
Back
Top