Font change after click (1 Viewer)

aattas

Registered User.
Local time
Tomorrow, 01:04
Joined
Dec 24, 2014
Messages
64
Experts,
need help

I have a report that has long list of items.one of the field is a link to the main form.
the request from my user if the color of the font could change after i click the selected item, This is similar to Google when you have chosen something the font color change as indication it has been clicked and seen,
Do access can do this?
 

theDBguy

I’m here to help
Local time
Today, 15:04
Joined
Oct 29, 2018
Messages
10,099
Hi. Is it a hyperlink field? If not, try using a hyperlink field.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:04
Joined
Aug 30, 2003
Messages
34,053
You mean even when you click elsewhere? It would require you to save the fact that the record has been seen somehow. Easiest would be a field in the same table, but that wouldn't work in a multiuser environment (unless one person "seeing" it should affect everyone).
 

isladogs

CID Moderator
Staff member
Local time
Today, 23:04
Joined
Jan 14, 2017
Messages
13,153
You can just add code like this

Code:
Private Sub ControlName_Click()
Me.ControlName.ForeColor = vbMagenta
End Sub
replacing ControlName with the actual name of your control.

Note that this will only work if the report is opened in report view...not print preview
 

aattas

Registered User.
Local time
Tomorrow, 01:04
Joined
Dec 24, 2014
Messages
64
Gentlemen,

Thanks for the suggestions, but i tried a field but it would not change the color.

I saw some using VBA to change color, but i dont understand how to do it.
 

theDBguy

I’m here to help
Local time
Today, 15:04
Joined
Oct 29, 2018
Messages
10,099
Gentlemen,

Thanks for the suggestions, but i tried a field but it would not change the color.

I saw some using VBA to change color, but i dont understand how to do it.
Hi. Did you try using a Hyperlink field? I tried it and it changed color after I clicked it. See below:




The above was before clicking the link field, and then after clicking the field, it looks like this:
 

Attachments

Last edited:

Mark_

Longboard on the internet
Local time
Today, 15:04
Joined
Sep 12, 2017
Messages
2,112
Are you using a report procedure to try to open an form in the same database? I just want to be very clear on what type of objects you are using. Normally you would not have a report open a form.
 

isladogs

CID Moderator
Staff member
Local time
Today, 23:04
Joined
Jan 14, 2017
Messages
13,153
OK here's a very basic example to explain what I meant
The app opens with the 'main form' Form1. This has a button to open Form2 which has a button to open the report.
Click the text on the report. It changes colour and reopens Form1

Hopefully this is what you wanted...
 

Attachments

theDBguy

I’m here to help
Local time
Today, 15:04
Joined
Oct 29, 2018
Messages
10,099
zeroaccess said:
I think that works in tables but not on forms. At least on mine it doesn't.
I don't know, I tried it on a form, and this is what I got.

link.png
 

zeroaccess

Active member
Local time
Today, 17:04
Joined
Jan 30, 2020
Messages
586
I don't know, I tried it on a form, and this is what I got.

View attachment 80924
You're too quick on the draw, Access World Ninja. You replied to my deleted post after I saw the date of the last post.

No matter - Just a guess, but I think it may depend on whether that field is locked. All of my hyperlink fields are locked with the hyperlink hand cursor and they stay blue. They are not http:// links, though, which may or may not also matter.
 

theDBguy

I’m here to help
Local time
Today, 15:04
Joined
Oct 29, 2018
Messages
10,099
You're too quick on the draw, Access World Ninja. You replied to my deleted post after I saw the date of the last post.

No matter - Just a guess, but I think it may depend on whether that field is locked. All of my hyperlink fields are locked with the hyperlink hand cursor and they stay blue. They are not http:// links, though, which may or may not also matter.
Ah, okay. Sorry.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom