AlisonEmmett
Technical User
I have a feeling this will be difficult to explain...
I have a table with structure as follows:
Server Text
Date Date
Stat1 Value
Stat2 Value
Stat3 Value
I have a form with combo boxes for Server and Stat
Thus the user chooses a particular server and a particluar Statistic (Stat1 or Stat2 or Stat3).
I then want to run a query based on those two choices. I can't write the query easily becasuse I don't know which Stat field will be chosen - and I don't want to have three queries and three buttons if I can avoid it.
Possibly I need some VB that changes my query to the appropriate Stat field before the query is actually run. Is this possible ?. Thus my query might be "Select Server,Avg(Stat1) from table; - but if the combo box choice is Stat2, then the query needs to change to "Select Server, Avg(Stat2) from table;
Does anyone understand the dilemma ???
any help gratefully received - I can't work out the code [sig][/sig]
I have a table with structure as follows:
Server Text
Date Date
Stat1 Value
Stat2 Value
Stat3 Value
I have a form with combo boxes for Server and Stat
Thus the user chooses a particular server and a particluar Statistic (Stat1 or Stat2 or Stat3).
I then want to run a query based on those two choices. I can't write the query easily becasuse I don't know which Stat field will be chosen - and I don't want to have three queries and three buttons if I can avoid it.
Possibly I need some VB that changes my query to the appropriate Stat field before the query is actually run. Is this possible ?. Thus my query might be "Select Server,Avg(Stat1) from table; - but if the combo box choice is Stat2, then the query needs to change to "Select Server, Avg(Stat2) from table;
Does anyone understand the dilemma ???
any help gratefully received - I can't work out the code [sig][/sig]