Hi All,
I'm essentially trying to extract a value from the pre_05_growth_f actor column of my traffic table and assign it to a variable to be used later.
Does anyone know why the code below returns "The growth is 0" when I run this code as part of an on-click event of a button on a form but if I isolate the Select statement and create a query with it in SQL View and then run it I get the correct result showing up from my table? This tells me my syntax is correct so why can I not assign the value from a select query to a variable? Thanks for any and all help.
I'm essentially trying to extract a value from the pre_05_growth_f actor column of my traffic table and assign it to a variable to be used later.
Does anyone know why the code below returns "The growth is 0" when I run this code as part of an on-click event of a button on a form but if I isolate the Select statement and create a query with it in SQL View and then run it I get the correct result showing up from my table? This tells me my syntax is correct so why can I not assign the value from a select query to a variable? Thanks for any and all help.
Code:
num_pre_05_growth = "SELECT traffic.PRE_05_GROWTH_FACTOR FROM traffic WHERE (((traffic.PCID)=[forms]![count_stations_form]![pcid]) AND ((traffic.COUNT)>0) AND ((traffic.TRAFFICID)=(SELECT Min(Traffic.TRAFFICID) AS MinOfTRAFFICID FROM Traffic where traffic.pcid = forms![count_stations_form]![pcid])))" MsgBox "The growth is " & Val(num_pre_05_growth)
Comment