R
Randy
Does anyone have any idea why this code will work in Access 2003 and NOT
Access 2007?
The database is split (if that matters); and the error I get is "The
Microsoft Office Access database engine could not find the object '0'. Make
sure the object exists and that you spell its name and the path name
correctly."
Private Sub Ok_Click()
On Error GoTo Ok_Click_Err
'using the customer sub form for customer state report to filter the
report, clicking ok will open report for selected state
Dim stDocName As String
Dim stLinkCriteria As String
If Not IsNull(Me.Search_Results) Then
stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"
End If
DoCmd.Close acForm, "Customers Sub Form For Customer State Report"
DoCmd.OpenReport "Customers by State", acPreview, acNormal,
WhereCondition = stLinkCriteria
Ok_Click_Exit:
Exit Sub
Ok_Click_Err:
MsgBox Err.Description
Resume Ok_Click_Exit
End Sub
Access 2007?
The database is split (if that matters); and the error I get is "The
Microsoft Office Access database engine could not find the object '0'. Make
sure the object exists and that you spell its name and the path name
correctly."
Private Sub Ok_Click()
On Error GoTo Ok_Click_Err
'using the customer sub form for customer state report to filter the
report, clicking ok will open report for selected state
Dim stDocName As String
Dim stLinkCriteria As String
If Not IsNull(Me.Search_Results) Then
stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"
End If
DoCmd.Close acForm, "Customers Sub Form For Customer State Report"
DoCmd.OpenReport "Customers by State", acPreview, acNormal,
WhereCondition = stLinkCriteria
Ok_Click_Exit:
Exit Sub
Ok_Click_Err:
MsgBox Err.Description
Resume Ok_Click_Exit
End Sub