G
Guest
I can't figure out how to display the results of a query that runs based on user inputs. The code is below.
Private Sub UserInput_Click()
On Error GoTo Err_UserInput_Click
Dim CurConn As New ADODB.Connection
Dim outputTB As New ADODB.Recordset
'Dim curDB As Database
Dim intPMvar As Integer
Dim SQLstmt As String
'Set curDB = CurrentDb
CurConn.Open CurrentProject.Connection
intPMvar = Me![Frame91]
Select Case intPMvar
Case 1 'Returns xxx Total
SQLstmt = "SELECT pm, sum(bps) FROM rpm_data WHERE pm = 'xxx' GROUP BY pm"
outputTB.Open SQLstmt, CurConn, adOpenStatic, adLockReadOnly, adCmdText
Now from here how do I get the results of the query to display.
Private Sub UserInput_Click()
On Error GoTo Err_UserInput_Click
Dim CurConn As New ADODB.Connection
Dim outputTB As New ADODB.Recordset
'Dim curDB As Database
Dim intPMvar As Integer
Dim SQLstmt As String
'Set curDB = CurrentDb
CurConn.Open CurrentProject.Connection
intPMvar = Me![Frame91]
Select Case intPMvar
Case 1 'Returns xxx Total
SQLstmt = "SELECT pm, sum(bps) FROM rpm_data WHERE pm = 'xxx' GROUP BY pm"
outputTB.Open SQLstmt, CurConn, adOpenStatic, adLockReadOnly, adCmdText
Now from here how do I get the results of the query to display.