Search results of a query and display in report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I have a query setup to search a field which contains the body of an
email message. The report shows the whole body. What i'd like to do is to
search each message from the results of that query for a username and keep
count of how many times each username shows up and display that at the end of
the report. I can use mid to display the username on the report, but the
results are not consistent. Is there any other function or way to store the
desired usernames?
 
The Instr function finds an occurrence of a string within another string.
Used repeatedly, it should do what you want. I'd create a
user-defined-function and call it in the Query that you use as RecordSource
of your Report. Report events may fire more than once and you might get more
than one search per record.

I'm not sure how you'd use Mid to _find_ the occurrences. But you don't need
to do so.

Larry Linson
Microsoft Access MVP
 
Thanks for the reply. I don't think i explained my problem thoroughly
enough. The username that i would be searching for would not be known. I
would need to find the username based on the text around it (it's an
automated email alert). I used the mid function and was able to get it to
show up, but i'm trying to get the unknown username and keep track of how
many times each one shows up. Hopefully that clears up a little more, i'd
appreciate any other help.
 
Back
Top