Question Highlighting particular text from nearby field to the adjacent field

njsphd

New member
Local time
Today, 15:23
Joined
Nov 5, 2013
Messages
1
Hi,
I am having a database in access and i want to highlight particular text from nearby column to the next column. For example,
--GCCCAGGCCCAAGAATGTCGCCGT GGAGGACTGTCTGTACATCAACGTGTTCGTGCCACGGCCCAGGCCCAAGAATGTCGCCGTCATGCTGTGGATCTTCGGGGGTGGCTTCTGACAAGCTATTGTGTTCGAATACACTGATT
--CGAATGAACGCTGTCCCTTCCACTGCTG GCAACATGCTCCCAGCCTTCGACAATGGCCCTCAATTCGAGGACTGGTTTCAACGAATGAACGCTGTCCCTTCCACTGCTGGAACTTCCGACTCCTTGTTGCCTAGAATGTCGCCGTCATGC

The first column text it should take as query and then it should only search the adjacent cell and highlight that.

While searching in the internet i came across a code also, But i dont know whether i can use that code or not.

ALTER PROCEDURE [dbo].[Search]
(
@searchTerm nvarchar(100),
@style nvarchar(100) = 'font-weight:bold; background-color:yellow',
@maxLen INT = 100
)
AS
BEGIN
SELECT
Id,
Name,
dbo.HighLightSearch(Description, @searchTerm, @style, @maxLen) AS Extract
FROM Documents
WHERE FREETEXT (Description, @searchTerm);
END

Please help me. Any help in this is highly appreciated. Other than access option also welcome.
 
I think you need to explain what you want to happen and when and why.

I cannot recall seeing anything like this. Do you have a Pic of a sample, or better still a copy of a database that has this.

Have you done a Google search.?

Where did you get this code.

ALTER PROCEDURE [dbo].[Search]
(
@searchTerm nvarchar(100),
@style nvarchar(100) = 'font-weight:bold; background-color:yellow',
@maxLen INT = 100
)
 
Hi,
I am having a database in access and i want to highlight particular text from nearby column to the next column. For example,
--GCCCAGGCCCAAGAATGTCGCCGT GGAGGACTGTCTGTACATCAACGTGTTCGTGCCACGGCCCAGGCCCAAGAATGTCGCCGTCATGCTGTGGATCTTCGGGGGTGGCTTCTGACAAGCTATTGTGTTCGAATACACTGATT
--CGAATGAACGCTGTCCCTTCCACTGCTG GCAACATGCTCCCAGCCTTCGACAATGGCCCTCAATTCGAGGACTGGTTTCAACGAATGAACGCTGTCCCTTCCACTGCTGGAACTTCCGACTCCTTGTTGCCTAGAATGTCGCCGTCATGC

The first column text it should take as query and then it should only search the adjacent cell and highlight that.

While searching in the internet i came across a code also, But i dont know whether i can use that code or not.

ALTER PROCEDURE [dbo].[Search]
(
@searchTerm nvarchar(100),
@style nvarchar(100) = 'font-weight:bold; background-color:yellow',
@maxLen INT = 100
)
AS
BEGIN
SELECT
Id,
Name,
dbo.HighLightSearch(Description, @searchTerm, @style, @maxLen) AS Extract
FROM Documents
WHERE FREETEXT (Description, @searchTerm);
END

Please help me. Any help in this is highly appreciated. Other than access option also welcome.
Are you running the database on an SQL server, (ALTER PROCEDURE)?
In Ms-Access you can use the Instr function. The text format for the control must be "Rich Text" and the same for the field in the table.
You also need to insert/ use "HTML" content, (like <Strong>Some bold text </Strong> for bold text.)
 
Last edited:
Tables have no events in which you can hang code so you cannot do this in a table. You could probably do it in a query but you would have to call a function.

Also keep in mind that if you are formatting only part of a string, the column must be displayed as Rich Text. I think Access uses HTML to format Rich Text so you would need to figure out the correct HTML tags and insert them at the appropriate spot in the string.
 

Users who are viewing this thread

Back
Top Bottom