'Declare variables for SQL query
Dim strSQL As String
Dim strTable As String
Dim strStat As String
Dim strGroup As String
Dim strTransform As String
Dim strPivot As String
Dim strDate As String
'Set variables for SQL query
If StatCombo.Value = "SNBE" Then
strTable = "TPERF_STATS_DAILY_CHT"
Else
strTable = "TPERF_STATS_DAILY_CC"
End If
strStat = StatCombo.Value
strGroup = GroupByCombo.Value
If StatCombo.Value = "CALLS_HANDLED" Then
strTransform = "Sum"
Else
strTransform = "Avg"
End If
Set qdf = CurrentDb.QueryDefs("Query1")
qdf.SQL = strSQL
Obviously you can create the various strings from which the query is built
however you want.
Hope this helps.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.