This is my function
Here is my query
I am trying to transform the column name of RowName to the global variable company name. Unfornately, it is just outputting the name as get_Global("CompanyName"). I did a step through and it does not go into the function to try and grab the value.
Any help would be great.
Code:
Global GBL_ReportName As String
Global GBL_CompanyId As Integer
Global GBL_CompanyName As String
Global GBL_RegionId As Integer
Global GBL_RegionName As String
Global GBL_TherapyAreaId As Integer
Global GBL_TherapyAreaName As String
Global GBL_CompanyTherapyName As String
Public Function get_global(G_name As String)
Select Case G_name
Case "ReportName"
get_global = GBL_ReportName
Case "CompanyName"
get_global = GBL_CompanyName
Case "RegionName"
get_global = GBL_RegionName
Case "CompanyId"
get_global = GBL_CompanyId
Case "RegionId"
get_global = GBL_RegionId
Case "TherapyAreaName"
get_global = GBL_TherapyAreaName
Case "TherapyAreaId"
get_global = GBL_TherapyAreaId
Case "CompanyTherapyName"
GBL_CompanyTherapyName = GBL_CompanyName & " " & GBL_TherapyAreaName
get_global = GBL_CompanyTherapyName
End Select
End Function
Here is my query
Code:
SELECT T_Reports.RowName AS [get_Global("CompanyName")], T_Reports.[2003 $ (m)], T_Reports.[2004 $ (m)], T_Reports.[2005 $ (m)], T_Reports.[2006 $ (m)], T_Reports.[2007 $ (m)], T_Reports.[F 2008 $ (m)], T_Reports.[F 2009 $ (m)], T_Reports.[F 2010 $ (m)], T_Reports.[F 2011 $ (m)], T_Reports.[F 2012 $ (m)], T_Reports.[F 2013 $ (m)], T_Reports.[F 2014 $ (m)]
FROM T_Reports
WHERE (((T_Reports.CompanyName)=get_Global("CompanyName")) AND ((T_Reports.ReportName)=get_Global("ReportName")))
ORDER BY T_Reports.OrderId;
I am trying to transform the column name of RowName to the global variable company name. Unfornately, it is just outputting the name as get_Global("CompanyName"). I did a step through and it does not go into the function to try and grab the value.
Any help would be great.