Create a table (BufferTable) in either database. It should have 2 fields: ReportName and FilterCriteria
Link it to the other database
Create a small form in the 'Reports' database and use the Load event (the commented code is for ADO):
Private Sub Load()
Dim rst As DAO.Database
'Dim rst As New ADODB.Recordset
Set rst = CurrentDB.OpenRecordset("Select * From BufferTable;"
'rst.Open "select * from buffertable;", CurrentProject.Connection, adOpenDynamic, adLockBatchOptimistic
If rst.EOF And rst.BOF Then
MsgBox "No records"
Quit 'no need to keep it open
Else
DoCmd.OpenReport rst.Fields(0), acViewPreview, , rst.Fields(1)
DoCmd.RunSQL "Delete * From BufferTable"
End If
rst.Close
Set rst = Nothing
End Sub
Set this form to load automatically on startup.
Now, the 'Forms' database-the command button that should open the report:
Sub CommandButton_Click()
DoCmd.RunSQL "Insert Into BufferTable (ReportName, FilterCriteria)" _
& "Values ('" & ReportName & "', '" & Criteria & "')"
Call Shell("msaccess.exe " & Chr(34) & "\\ServerName\ShareName\Reports.mdb" & Chr(34), vbMaximizedFocus)
'Quit
End Sub
This will pass the report name and the filter condition to the 'common table' and the values will be used by the startup form in the reports database to open the correct object...
But...
20 MB for 5 reports??? Do you have objects embedded into them? If yes, you could try to link the pictures, this will make the file really smaller
What about the tables-where are they located?
HTH
![[pipe] [pipe] [pipe]](/data/assets/smilies/pipe.gif)
Daniel Vlas
Systems Consultant