This is what I tried, but its not working
Private Sub getRecord()
Dim strSQL As String
If IsNull(Me.txtSdpth) Then
strSQL = "SELECT qrySoilst1.Domain, qrySoilst1.Analyte,
Sum(qrySoilst1.NDVal) AS SumOfNDVal, Avg(qrySoilst1.Result) AS
AvgOfResult, Max(qrySoilst1.Result) AS MaxOfResult,
StDev(qrySoilst1.Result) AS StDevOfResult, Count(qrySoilst1.Result) AS
CountOfResult, [Domain] & '_' & [Analyte] AS JoinID" & _
"FROM qrySoilst1" & _
"GROUP BY qrySoilst1.Domain, qrySoilst1.Analyte" & _
"HAVING (((qrySoilst1.Domain)=[Forms]![frmSoilAnal]![cmbZone]) AND
((qrySoilst1.Analyte)=[Forms]![frmSoilAnal]![cmbAnalyte]));"
Else
strSQL = " Some other SQL"
End If
Me.RecordSource = strSQL
Me.Requery
End Sub
hi all,
I am creating a form which changes the form "recordsource" query
according to selection on combo box. Any idea how I can do this??.
Thanks ,
Kumar