I have a form which has an OnClose event handler connected...
What it does is simply to open the form called MyFormName but of course the first record will be displayed and that is not optimal.
I have an ID number which is the primary key (called "ID_B") for the form stored in a public variable called "MyPublicVar". It is also the record number "MyPublicVar" in the form that I would like to display when closing the report....
How can I achieve this?
Maybe I can add a "DoCmd.GoToRecord...." line after the above "DoCmd OpenForm" code (even though I am not knowledgable enough to know what that line should look like...
Perhaps there is a smarter solution?
Any help will be appreciated.
Code:
Private Sub Report_Close()
DoCmd.OpenForm "MyFormName"
End Sub
What it does is simply to open the form called MyFormName but of course the first record will be displayed and that is not optimal.
I have an ID number which is the primary key (called "ID_B") for the form stored in a public variable called "MyPublicVar". It is also the record number "MyPublicVar" in the form that I would like to display when closing the report....
How can I achieve this?
Maybe I can add a "DoCmd.GoToRecord...." line after the above "DoCmd OpenForm" code (even though I am not knowledgable enough to know what that line should look like...
Perhaps there is a smarter solution?
Any help will be appreciated.