Hyperlink to Form (1 Viewer)

Mackbear

Registered User.
Local time
Today, 05:57
Joined
Apr 2, 2019
Messages
168
Hello everyone!

Reaching out for help again, I have a datasheet form (image attached). I have made one of the fields displayed as hyperlink, I am trying to make the "hyperlink" show the "contents" filtered in a form view upon clicking on the "hyperlink". I tried the openform macro and on the condition I entered ="[PMC]=" & [PMC], but it only opens the form without the filter. Help! :banghead: Thank you very much in advance!
 

Attachments

  • Dashboard.PNG
    Dashboard.PNG
    55.3 KB · Views: 42

Gasman

Enthusiastic Amateur
Local time
Today, 10:57
Joined
Sep 21, 2011
Messages
14,038
PMC looks like text?

Text generally needs to be surrounded with single quotes.

Try
Code:
="[PMC]=[COLOR="Red"]'[/COLOR]" & [PMC] & "[COLOR="red"]'[/COLOR]"

HTH
 

Mackbear

Registered User.
Local time
Today, 05:57
Joined
Apr 2, 2019
Messages
168
Thank you very much!, I missed that, I was following a code I saw that used the primary key which is a number. :D:D:D. Thank you, I appreciate it!
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:57
Joined
Sep 21, 2011
Messages
14,038
FWIW if you ever get to use dates, they should be surrounded by #.
 

Mackbear

Registered User.
Local time
Today, 05:57
Joined
Apr 2, 2019
Messages
168
I have come across another issue, I am trying to add another criteria to filter and now my code is ="[PMC]='" & [PMC] & "' And [cbstatus]='In Progress'". cbstatus is a field in the table of the other form I am trying to open. and the value I would like to filter is if it is In Progress. Not sure what I was missing. It is asking me for a parameter value
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:57
Joined
Sep 21, 2011
Messages
14,038
No, you only put the single quotes around the criteria

Code:
="[PMC]='" & [PMC] & "' And [cbstatus]='" In Progress & "'"
 

Mackbear

Registered User.
Local time
Today, 05:57
Joined
Apr 2, 2019
Messages
168
No, you only put the single quotes around the criteria

Code:
="[PMC]='" & [PMC] & "' And [cbstatus]='" In Progress & "'"

Awwwtz it says I have invalid value on the criteria
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:57
Joined
Sep 21, 2011
Messages
14,038
Inspect each variable.
That code expects a value for each variable. If one could be empty/null, you would need to do extra.
 

Mackbear

Registered User.
Local time
Today, 05:57
Joined
Apr 2, 2019
Messages
168
For the benefit of others, please explain what the problem was and how you solved it.

TIA

I apologize for the late reply, i checked it and i realized that i have the field name incorrect so it was fixed when i corrected the field name cbstatus to status. Thanks for your help everyone!
 

Users who are viewing this thread

Top Bottom