Font change after click (1 Viewer)

aattas

Registered User.
Local time
Today, 18:23
Joined
Dec 24, 2014
Messages
74
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
Staff member
Local time
Today, 08:23
Joined
Oct 29, 2018
Messages
21,358
Hi. Is it a hyperlink field? If not, try using a hyperlink field.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:23
Joined
Aug 30, 2003
Messages
36,118
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

MVP / VIP
Local time
Today, 15:23
Joined
Jan 14, 2017
Messages
18,186
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
Today, 18:23
Joined
Dec 24, 2014
Messages
74
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
Staff member
Local time
Today, 08:23
Joined
Oct 29, 2018
Messages
21,358
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

  • BeforeClick.PNG
    BeforeClick.PNG
    5.5 KB · Views: 235
  • AfterClick.PNG
    AfterClick.PNG
    5.4 KB · Views: 252
Last edited:

Mark_

Longboard on the internet
Local time
Today, 08:23
Joined
Sep 12, 2017
Messages
2,111
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

MVP / VIP
Local time
Today, 15:23
Joined
Jan 14, 2017
Messages
18,186
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

  • ColourChangeExample.accdb
    388 KB · Views: 119

theDBguy

I’m here to help
Staff member
Local time
Today, 08:23
Joined
Oct 29, 2018
Messages
21,358
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, 10:23
Joined
Jan 30, 2020
Messages
671
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
Staff member
Local time
Today, 08:23
Joined
Oct 29, 2018
Messages
21,358
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

Top Bottom