Error on DB closing r/t Report

Digger442

Registered User.
Local time
Today, 22:49
Joined
Dec 16, 2002
Messages
23
I have been experiencing an error in Access2K after viewing a report during the session. When I close the database after viewing a report I get the "Can't save this record at this time....." error msg.

I have narrowed it down to running the report. If I open any report during a session I get this msg...regardless of if I have attempted to change any data in the tables.

I use a button-activated event procedue to run the report, though the report itself it based on queries and sub-reports:

Private Sub Command113_Click()
Forms![Navigator].Form.Controls!MRN = Me.MRN
DoCmd.OpenReport "Lab Report", acViewPreview
End Sub

Any thoughts would be greatly appreciated......
 
Do you close the close the report b/4 you close the database?
 
This statement - Forms![Navigator].Form.Controls!MRN = Me.MRN - is dirtying a record causing Access to want to save it. What do you think this statement is doing?
 
Thanks for the replies!

Yes, I close the form before I close the DB.

To the best of my knowledge (and I am no programmer!) that line in the code refers to a hidden control on main user interface that acta as a 'placemarker' for a selected MRN (medical record number - the primary key tying all the tables together) so that it may be used to open MRN specifc DE forms or reports....in other words a record is selected on one form which records the number in that control and then any other reports/forms that are opened use that MRN.....

Is this clear as mud? I didn't design it this way.....and now that I write it out, it seems that an easier method must exist. I have the same method in an Access97 DB that works fine. It is only in the 2K versions that I have this problem.

Any further thoughts?

Thanks.......
 
The statement in question is not controlling what the report shows unless the report's query is referring to the Navigator form for its selection criteria. Take a look at the report's query. If it does not refer to the Navigator form, comment out the line of code that is dirtying that form and see what happens.
 
Thanks for your thoughts. The underlying query does indeed refer to the Navigator form for record selection. Your comments steered me in the right direction though.....I fixed it by using both the 'On Click' and 'On Exit' properties. 'On Click' closed the form and 'On Exit' closes the DB via a macro (Quit).

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom