It is my old issue.
I need to run MakeTable query that all other queries will be pulling and manipulating data from.
So at the beginning of running Report I need to run MakeTable query.
I have a form. Form had a button. On a click of this button I am running a code you shared with me:
Private Sub cmd_School_Click()
Dim strWhere As String
On Error GoTo ErrHandler
DoCmd.SetWarnings False
'DoCmd.OpenQuery "4-qry_Make_School_Report"
If Not IsNull(Forms!Campus_Reports_Switchboard!cmb_School) Then
strWhere = "SCHOOL=" & Chr(34) & Forms!Campus_Reports_Switchboard!cmb_School.Column(0) & Chr(34)
End If
DoCmd.OpenReport ReportName:="Campus_by_School", View:=acViewPreview, WhereCondition:=strWhere
Exit Sub
ErrHandler:
If Err = 2501 Then
' Report canceled - ignore this
Else
MsgBox Err.Description, vbExclamation
End If
End Sub
__________________________
So I needed to have this MakeTable query to be run somehow so I stuck it here
DoCmd.SetWarnings False
'DoCmd.OpenQuery "4-qry_Make_School_Report"
Now after Report is up and then closed and I want to run ANOTHER Report it says 'Table School_Report can not be locked because it is used by another person or process'
When I take this line away 'DoCmd.OpenQuery "4-qry_Make_School_Report"
none of these messages appear, so how do I run that query because I really have to...
It is even happening when I make an Oracle tables local.
Thanks
I need to run MakeTable query that all other queries will be pulling and manipulating data from.
So at the beginning of running Report I need to run MakeTable query.
I have a form. Form had a button. On a click of this button I am running a code you shared with me:
Private Sub cmd_School_Click()
Dim strWhere As String
On Error GoTo ErrHandler
DoCmd.SetWarnings False
'DoCmd.OpenQuery "4-qry_Make_School_Report"
If Not IsNull(Forms!Campus_Reports_Switchboard!cmb_School) Then
strWhere = "SCHOOL=" & Chr(34) & Forms!Campus_Reports_Switchboard!cmb_School.Column(0) & Chr(34)
End If
DoCmd.OpenReport ReportName:="Campus_by_School", View:=acViewPreview, WhereCondition:=strWhere
Exit Sub
ErrHandler:
If Err = 2501 Then
' Report canceled - ignore this
Else
MsgBox Err.Description, vbExclamation
End If
End Sub
__________________________
So I needed to have this MakeTable query to be run somehow so I stuck it here
DoCmd.SetWarnings False
'DoCmd.OpenQuery "4-qry_Make_School_Report"
Now after Report is up and then closed and I want to run ANOTHER Report it says 'Table School_Report can not be locked because it is used by another person or process'
When I take this line away 'DoCmd.OpenQuery "4-qry_Make_School_Report"
none of these messages appear, so how do I run that query because I really have to...
It is even happening when I make an Oracle tables local.
Thanks