By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,916 Members | 1,068 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,916 IT Pros & Developers. It's quick & easy.

Two problems in Access

P: n/a
Thanks again guys, for your recent assistance. Now as you were so kind to
assist the first time (the solution was so simple and elegant) I was
wondering if you could assist with another couple of problems I am faced
with.

Problem 1
I have a memo field called NOTES in my database and I have constructed
various queries so the user can search this NOTES memo field for any
freetext held within it. As this memo field has large chunks of text inside
it, the search results are not easy to find, do you know how I can turn the
search result on the form into a hi-lighted result? and with every other
occurrence to be highlighted as well in this NOTES field, on the current
record and any subsequent records the query would find?

Example of my Criteria in the Query:
Like "*" & [Search NOTES for the following ] & "*"

Problem 2
I have one main table with a a few other tables, all linked together with
under a URN (Unique Ref No) e.g., How can I create a query on my Search form
that will search or filter out, say an address or telephone number from the
relevant Subform and display the result (possibly hi-lighted) in the Form
InputRecords?

Tables
Table - InputRecords
Table - InputRecordsAddr
Table - Input RecordsTelNos
Table - Input RecordsPersonalDetails

Forms
Form - MainMenu
Form - InputRecords
Form - SubformAddr
Form - SubformTelNos
Form - SubformPersonalDetails
Form - Searching

Any and all assistance will of course be received with the greatest of
appreciation from this novice bottom rung amebia MSAccess developer can
summon.

Jan Szymczuk

www.szymczuk.co.uk
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Problem 1
The Textbox in Access cannot format part of the text differently, so it
cannot highlight the search results.

If this is really important to you, it may be possible to download a rich
text box, and programmatically generate the rich text. Stephen Lebans has
one at:
www.lebans.com

Problem 2
See:
Filter a Form on a Field in a Subform
at:
http://members.iinet.net.au/~allenbrowne/ser-28.html
The article explains how to set the RecordSource of the main form to an
inner join statement so that it contains only those records that have a
match in the subform. It would also be possible to use a subquery in the
Filter of the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jan Szymczuk" <sz******@btinternet.com> wrote in message
news:cq**********@sparta.btinternet.com...
Thanks again guys, for your recent assistance. Now as you were so kind to
assist the first time (the solution was so simple and elegant) I was
wondering if you could assist with another couple of problems I am faced
with.

Problem 1
I have a memo field called NOTES in my database and I have constructed
various queries so the user can search this NOTES memo field for any
freetext held within it. As this memo field has large chunks of text
inside it, the search results are not easy to find, do you know how I can
turn the search result on the form into a hi-lighted result? and with
every other occurrence to be highlighted as well in this NOTES field, on
the current record and any subsequent records the query would find?

Example of my Criteria in the Query:
Like "*" & [Search NOTES for the following ] & "*"

Problem 2
I have one main table with a a few other tables, all linked together with
under a URN (Unique Ref No) e.g., How can I create a query on my Search
form that will search or filter out, say an address or telephone number
from the relevant Subform and display the result (possibly hi-lighted) in
the Form InputRecords?

Tables
Table - InputRecords
Table - InputRecordsAddr
Table - Input RecordsTelNos
Table - Input RecordsPersonalDetails

Forms
Form - MainMenu
Form - InputRecords
Form - SubformAddr
Form - SubformTelNos
Form - SubformPersonalDetails
Form - Searching

Any and all assistance will of course be received with the greatest of
appreciation from this novice bottom rung amebia MSAccess developer can
summon.

Jan Szymczuk

www.szymczuk.co.uk

Nov 13 '05 #2

P: n/a
Jan,

Problem1

I have this solution for problem 1: it highlightes the serachtext
(Tekstkeuze) in the memofield (Beschrijving) and waits 3 sec. before showing
the next apperance in the same memo by using SelStart and SelLength.
The routine ends with a msgbox: "serachstring is 2 times found in this memo
and now you see the last apperance"
Sorry for my English !
I hope its usefull.

Filip
Dim intWaar, aantal, startPositie As Integer
startPositie = 1
Me!Beschrijving.SetFocus
If InStr(startPositie, Me!Beschrijving, Tekstkeuze) = 0 Then MsgBox "Niet in
deze tekst": Exit Sub
Do
intWaar = InStr(startPositie, Me!Beschrijving, Tekstkeuze)
Me!Beschrijving.SelStart = intWaar - 1
Me!Beschrijving.SelLength = Len(Tekstkeuze) ' Lengte selectie instellen.
startPositie = intWaar + Len(Tekstkeuze)
aantal = aantal + 1
Wait(3)
Loop Until InStr(startPositie, Me!Beschrijving, Tekstkeuze) = 0
If aantal <> 1 Then MsgBox "'" & Tekstkeuze & "' is " & aantal & " keer in
deze tekst" & Chr(13) & "U ziet de laatste geselecteerd"


"Jan Szymczuk" <sz******@btinternet.com> wrote in message
news:cq**********@sparta.btinternet.com...
Thanks again guys, for your recent assistance. Now as you were so kind to
assist the first time (the solution was so simple and elegant) I was
wondering if you could assist with another couple of problems I am faced
with.

Problem 1
I have a memo field called NOTES in my database and I have constructed
various queries so the user can search this NOTES memo field for any
freetext held within it. As this memo field has large chunks of text inside it, the search results are not easy to find, do you know how I can turn the search result on the form into a hi-lighted result? and with every other
occurrence to be highlighted as well in this NOTES field, on the current
record and any subsequent records the query would find?

Example of my Criteria in the Query:
Like "*" & [Search NOTES for the following ] & "*"

Problem 2
I have one main table with a a few other tables, all linked together with
under a URN (Unique Ref No) e.g., How can I create a query on my Search form that will search or filter out, say an address or telephone number from the relevant Subform and display the result (possibly hi-lighted) in the Form
InputRecords?

Tables
Table - InputRecords
Table - InputRecordsAddr
Table - Input RecordsTelNos
Table - Input RecordsPersonalDetails

Forms
Form - MainMenu
Form - InputRecords
Form - SubformAddr
Form - SubformTelNos
Form - SubformPersonalDetails
Form - Searching

Any and all assistance will of course be received with the greatest of
appreciation from this novice bottom rung amebia MSAccess developer can
summon.

Jan Szymczuk

www.szymczuk.co.uk

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.