Did you have a reason for setting the form's RecordSource in its Close
event? Since the form is closing anyway, it does not seem like a useful
thing to do, and yes, it can have undesirable side effects.
Perhaps you are trying to avoid the situation where users are changing to
design view and saving the RecordSource so it loads wrongly next time? If
so, perhaps you could use code in the Open event of the form to initialize
the form correctly instead of trying to reset it in Form_Close.
A nasty side effect of setting the form's RecordSource is that it becomes
unbound. Then every bound control is going to generate an error (or perhaps
a parameter request.) You really don't want to do that! To avoid that, you
could set the RecordSource so it has all fields but no records, e.g.:
SELECT * FROM Table1 WHERE (False);
I sometimes do that in Form_Open, but it still makes no sense to me in
Form_Close.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hello
>
[quoted text clipped - 21 lines]
> Thanks
> G Gerard
G Gerard - 09 Jan 2007 22:34 GMT
Hello Allen
Thank you for your reply
The reason I am setting RecordSource during the OnClose event
is so I can delete the temporary table I have created (in another mdb)
during the OnOpen event of the form to which the form is then bound.
It’s a long explanation why I’m doing this but in short it’s to give the
user the option of saving or not saving the changes made when closing the
form
while trying to avoid bloating of my main mdb on a multi user application.
(with my knowledge of Access that’s the best way I have managed to do this)
I didn’t think that unbounding the form during the OnClose would create any
problem since at this point the records from the temporary table have been
copied to a main table and the form is an instance.
I will change the RecordSource to (SELECT * FROM Table1 WHERE (False);)
instead of zero length string; it makes a lot more sense.
Thanks
G Gerard
> Did you have a reason for setting the form's RecordSource in its Close
> event? Since the form is closing anyway, it does not seem like a useful
[quoted text clipped - 40 lines]
>> Thanks
>> G Gerard