Laura Sheldon
asked on
Access 2007, formatting a hyperlink in a crosstab query to use in a form
I have built a crosstab query (and the same happens in a regular query) to pull email info for my communities which is stored in the table as a hyperlink and when it returns the result, they come back in hyperlink format (i.e., laura.sheldon@laurasheldon .com#mailt o:laura.sh eldon@laur asheldon.c om#) and I'd like to know if and how I can format this to return as just the email address, either in the CTQ/QRY or in the form that's based on it.
Query expression:
FmtEmaiAddr: Left([EMAIL_ADDRESS],InStr (1,[EMAIL_ ADDRESS]," #")-1)
mx
FmtEmaiAddr: Left([EMAIL_ADDRESS],InStr
mx
Same expression can be used in the Control Source of a Text box on a Form or Report:
=Left([EMAIL_ADDRESS],InSt r(1,[EMAIL _ADDRESS], "#")-1)
mx
=Left([EMAIL_ADDRESS],InSt
mx
What view are you using to display the email addresses? If you only have one filed that you are using on the form, if you set the fields hyperlink to null it should show up as plain old text.
Me.EmailAdd.HyperlinkAddre ss = ""
to set it back you can use something like this
Me.EmailAdd.HyperlinkAddre ss = "mailto:" & Me.EmailAddress
This will basically remove the hyperlink all together and then put it back when you are done.
TLH
Me.EmailAdd.HyperlinkAddre
to set it back you can use something like this
Me.EmailAdd.HyperlinkAddre
This will basically remove the hyperlink all together and then put it back when you are done.
TLH
ASKER
DatabaseMX,
In this SQL statement:
PARAMETERS [Start Date] DateTime;
TRANSFORM Sum(CommunityBillingTBL.[B ill Amount]) AS [SumOfBill Amount]
SELECT CommunityInfoListTBL.Commu nity, CommunityContactsTBL.[Mana gement Co], CommunityBillingTBL.[Contr act Type], CommunityBillingTBL.[Servi ce Description], CommunityBillingTBL.[Billi ng to Community (360)], CommunityBillingTBL.[Billi ng to Client (Fee)], IIf([Billing To Community (360)]=True,[DOCO] & ", " & [Doco Phone]) AS [360 Billing Contact], IIf([Billing to Community (360)]=True,[DOCO Email]) AS [360 Billing Contact Email], IIf([Billing To Community (360)]=True,[Address1] & ", " & [Address2] & " " & [City] & ", " & [State] & " " & [ZipCode]) AS [360 Billing Addy], IIf([Billing To Client (Fee)]=True,[ClientContact ] & ", " & [ClientPhone]) AS [Fee Billing Contact], IIf([Billing to Client (Fee)]=True,[ClientEmail]) AS [Fee Billing Contact Email], IIf([Billing To Client (Fee)]=True,[ClientAddress 1] & ", " & [ClientAddress2] & " " & [ClientCity] & ", " & [ClientState] & " " & [ClientZipCode]) AS [Fee Billing Addy], IIf([Billing to Community (360)]=True,[360 Billing Contact],[Fee Billing Contact]) AS [Billing Contact], IIf([Billing to Community (360)]=True,[360 Billing Contact Email],[Fee Billing Contact Email]) AS [Billing Contact Email], IIf([Billing to Community (360)]=True,[360 Billing Addy],[Fee Billing Addy]) AS [Billing Address], Sum(CommunityBillingTBL.[B ill Amount]) AS [Total Of Bill Amount]
FROM CommunityContactsTBL INNER JOIN (CommunityInfoListTBL INNER JOIN CommunityBillingTBL ON CommunityInfoListTBL.Commu nity = CommunityBillingTBL.Commun ity) ON CommunityContactsTBL.ID = CommunityInfoListTBL.ID
WHERE (((CommunityBillingTBL.[Bi ll Date])>=[Start Date]))
GROUP BY CommunityInfoListTBL.Commu nity, CommunityContactsTBL.[Mana gement Co], CommunityBillingTBL.[Contr act Type], CommunityBillingTBL.[Servi ce Description], CommunityBillingTBL.[Billi ng to Community (360)], CommunityBillingTBL.[Billi ng to Client (Fee)], IIf([Billing To Community (360)]=True,[DOCO] & ", " & [Doco Phone]), IIf([Billing to Community (360)]=True,[DOCO Email]), IIf([Billing To Community (360)]=True,[Address1] & ", " & [Address2] & " " & [City] & ", " & [State] & " " & [ZipCode]), IIf([Billing To Client (Fee)]=True,[ClientContact ] & ", " & [ClientPhone]), IIf([Billing to Client (Fee)]=True,[ClientEmail]) , IIf([Billing To Client (Fee)]=True,[ClientAddress 1] & ", " & [ClientAddress2] & " " & [ClientCity] & ", " & [ClientState] & " " & [ClientZipCode])
ORDER BY CommunityBillingTBL.[Contr act Type]
PIVOT CommunityBillingTBL.[Bill Date];
Where would your first reply go, exactly?
(Left("laura.sheldon@laura sheldon.co m#mailto:l aura.sheld on@laurash eldon.com# ",Instr(1, "laura.she ldon@laura sheldon.co m#mailto:l aura.sheld on@laurash eldon.com# ","#")-1)
In this SQL statement:
PARAMETERS [Start Date] DateTime;
TRANSFORM Sum(CommunityBillingTBL.[B
SELECT CommunityInfoListTBL.Commu
FROM CommunityContactsTBL INNER JOIN (CommunityInfoListTBL INNER JOIN CommunityBillingTBL ON CommunityInfoListTBL.Commu
WHERE (((CommunityBillingTBL.[Bi
GROUP BY CommunityInfoListTBL.Commu
ORDER BY CommunityBillingTBL.[Contr
PIVOT CommunityBillingTBL.[Bill Date];
Where would your first reply go, exactly?
(Left("laura.sheldon@laura
ASKER
Also, if I'm returning results from several records so I need to know how to format this across the board rather than having a specific email address designated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This did the trick! Thanks!
You are welcome.
mx
mx
ASKER
DatabaseMX,
I used this in a form and it worked great, but can you tell me how, if possible, I can use it in a query? I tried it as an expression based on the email field I was trying to format but it didn't work.
Thanks,
I used this in a form and it worked great, but can you tell me how, if possible, I can use it in a query? I tried it as an expression based on the email field I was trying to format but it didn't work.
Thanks,
Left("laura.sheldon@lauras
returns:
laura.sheldon@laurasheldon