G
Guest
This may get complicated. We've been playing around with it forever...
I have a form with a subform. the user selects a couple of criteria and
then the subform is supposed to populate depending on that criteria. There
is a results table, whose fields include resultID, OpID, OpNum, date, day,
Shift, and panels. There is a PanelJob table whose fields include OpId and
Operation. (Ex: 1, Drill)
There is a PanelJobDetail table whose fields include OpNum, OpID, and
OperationDetail (Ex: 1, 1, Drilled Panel). As if that isn't confusing
enough....
The subform needs to show Operation, OperationDetail, date, day, Shift, and
Shift_Units (# of units completed during the user's shift). this is our sql
statement, which includes an inner join to get Operation and Operation detail
*instead of*OpId and OpNum...
Dim strSelectSQL As String
strSelectSQL = "SELECT tblPanelJob.Operation,
tblPanelJobDetail.OperationDetail,tblResults.date," & _
"tblResults.day, tblResults.Shift, tblResults.panels FROM " & _
"(tblPanelJob INNER JOIN tblPanelJobDetail ON
tblPanelJob.OpID=tblPanelJobDetail.OpID)" & _
"INNER JOIN tblResults ON (tblPanelJob.OpID=tblResults.OpID) AND " & _
"(tblPanelJobDetail.OpNum=tblResults.OpNum) WHERE " & _
"tblPanelJob.Operation= " & cboOperation.Value & " AND
tblPanelJobDetail.OperationDetail = " & _
cboOperationDetail.Value & " AND tblResults.[date] = " & txtDate.Value
CurrentDb.Execute (strSelectSQL)
We've been over and over the SQL statement, and we're just not seeing it.
Now, the error we're getting is Run-Time Error 3065: "Cannot Execute a Select
Query"
Can someone help me figure this one out?
Much appreciated!!
Seren
I have a form with a subform. the user selects a couple of criteria and
then the subform is supposed to populate depending on that criteria. There
is a results table, whose fields include resultID, OpID, OpNum, date, day,
Shift, and panels. There is a PanelJob table whose fields include OpId and
Operation. (Ex: 1, Drill)
There is a PanelJobDetail table whose fields include OpNum, OpID, and
OperationDetail (Ex: 1, 1, Drilled Panel). As if that isn't confusing
enough....
The subform needs to show Operation, OperationDetail, date, day, Shift, and
Shift_Units (# of units completed during the user's shift). this is our sql
statement, which includes an inner join to get Operation and Operation detail
*instead of*OpId and OpNum...
Dim strSelectSQL As String
strSelectSQL = "SELECT tblPanelJob.Operation,
tblPanelJobDetail.OperationDetail,tblResults.date," & _
"tblResults.day, tblResults.Shift, tblResults.panels FROM " & _
"(tblPanelJob INNER JOIN tblPanelJobDetail ON
tblPanelJob.OpID=tblPanelJobDetail.OpID)" & _
"INNER JOIN tblResults ON (tblPanelJob.OpID=tblResults.OpID) AND " & _
"(tblPanelJobDetail.OpNum=tblResults.OpNum) WHERE " & _
"tblPanelJob.Operation= " & cboOperation.Value & " AND
tblPanelJobDetail.OperationDetail = " & _
cboOperationDetail.Value & " AND tblResults.[date] = " & txtDate.Value
CurrentDb.Execute (strSelectSQL)
We've been over and over the SQL statement, and we're just not seeing it.
Now, the error we're getting is Run-Time Error 3065: "Cannot Execute a Select
Query"
Can someone help me figure this one out?
Much appreciated!!
Seren