A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

One Result from multiple memo fields



 
 
Thread Tools Display Modes
  #11  
Old May 8th, 2007, 06:54 PM posted to microsoft.public.access.reports
Sunflower
external usenet poster
 
Posts: 44
Default One Result from multiple memo fields

On May 7, 12:30 pm, "John Spencer" wrote:
Looks as if we need to add at least one more field to the subquery and join
on that field also

SELECT dbo_RB_JOBNOTE.JOBID
, NZ(T.NOTE, "No Material Listing Found") as MaterialNote
, dbo_RB_JOBNOTE.OWNERFULLNAME
FROM dbo_RB_JOBNOTE LEFT JOIN
(SELECT JobID, NOTE, OWNERFULLNAME
FROM dbo_RB_JOBNOTE
WHERE NOTE Like "Material*" ) as T
ON dbo_RB_JobNOTE.JobID = T.JobID
AND dbo_RB_JobNOTE.OWNERFULLNAME = T.OWNERFULLNAME

Somehow I missed the OwnerFullName in your earlier postings. Hopefully the
combination of JobID and OwnerFullName is sufficient to give you the results
you want.

If not, construct a query that gives you what you want if Note is Like
"Material*". Save that query and then use it to build a query with
dbo_RB_Jobnote where you join on the relevant fields. Double-click on the
join lines and set them to show all records in dbo_RB_Jobnote and only
matching in the saved query. If there are no "material" notes then you
will get a record with fields from dbo_RB_JobNote and blank fields for the
fields from the saved query.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.





I put in your SQL
Here is a sample of what I am getting:
-------------------------------------------------------
Notes
Jesi
Materials:3 pieces Letter paper
Janice
Materials:3 pieces Letter paper


Notes
George
Materials Used
16 feet of 24 inch satin photo base
16 feet of 40 inch 5 mil laminate
George
Materials Used
16 feet of 24 inch satin photo base
16 feet of 40 inch 5 mil laminate


Notes
George
No Material Listing Found
George
No Material Listing Found
Janice
No Material Listing Found


Notes
Travis
No Material Listing Found
Janice
No Material Listing Found
Janice
No Material Listing Found


Notes
Janice
No Material Listing Found
Janice
No Material Listing Found
-------------------------------------
I am not sure why it is doing this, but I do know it is repeating.- Hide quoted text -


- Show quoted text -


I constructed a query that gave me what I wanted if Note is Like
"Material*".
Saved that query as qryMATERIALNOTES

SELECT dbo_RB_JOBNOTE.JOBID, dbo_RB_JOBNOTE.NOTE
FROM dbo_RB_JOBNOTE
WHERE (((dbo_RB_JOBNOTE.NOTE) Like "Materials*"))
ORDER BY dbo_RB_JOBNOTE.JOBID;

--------------------------------
Built a query with dbo_RB_Jobnote where I joined on the JOBID fields.
Saved that query as qryNULL_MATERIALS

SELECT qryMATERIALNOTES.JOBID, qryMATERIALNOTES.NOTE
FROM qryMATERIALNOTES RIGHT JOIN dbo_RB_JOBNOTE ON
qryMATERIALNOTES.JOBID = dbo_RB_JOBNOTE.JOBID;

----------------------------------
I Double-clicked on the join lines of qryNULL_MATERIALS and set them
to show all records only matching in the saved query.

------------------------------------
In my subreport -- subrptMATERIALNOTES
with control source of -- qryNULL_MATERIALS
I created a text box -- txtMaterialNote
with the following control source:
=IIf(IsNull([NOTE]),"No Material listing found",[NOTE])

-------------------------------------

I am getting the "Enter Parameter Value ID" dialog box,
when I click OK... I get repeated values like before...

I am clueless on how to even know where to start fixing this

AUUUGHH! as Charlie Brown says.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.