hi,

i have this code for opening a report in access
Code:
Dim strDocName As String
Dim strWhere As String
    strDocName = "MyReport"
    strWhere = "[serial]=" & Me!txtserial
    DoCmd.OpenReport strDocName, acPreview, , strWhere
it is working fine when my database is open , when i close my database and press the print button i get an error msg:
you can't carry out this action at the present time.
and the error at this line :
DoCmd.OpenReport strDocName, acPreview, , strWhere

why when i close my database i get this error?