R
Raul Sousa
I have posted this thread last week.
I apologize for posting it again but I could not solve my question.
May be someone else can give me an idea.
I need when closing a form to open a report on a specific record.
So, I have this code:
Private Sub Form_close()
DoCmd.OpenReport "Invoice", acViewPreview, , "[DocId] = """ & Me.[DocID]
& """", acNormal
End Sub
The problem is that it opens the report always on the first record, no
matter which DocId I have.
If I run the code without closing the form it works fine.
I guess that the Form_close() event runs the code after closing the form and
so Me.DocId is Null.
Is there any way for running the code before closing the form?
I apologize for posting it again but I could not solve my question.
May be someone else can give me an idea.
I need when closing a form to open a report on a specific record.
So, I have this code:
Private Sub Form_close()
DoCmd.OpenReport "Invoice", acViewPreview, , "[DocId] = """ & Me.[DocID]
& """", acNormal
End Sub
The problem is that it opens the report always on the first record, no
matter which DocId I have.
If I run the code without closing the form it works fine.
I guess that the Form_close() event runs the code after closing the form and
so Me.DocId is Null.
Is there any way for running the code before closing the form?