Help !
I have a form which shows various levels of information depending on parameters selected by a user. A recordset is generated, form opened in design view, recordset and various other bits changed, form saved and opened in normal view - everything is fine.
I have another button on the opened form. This closes the form and runs the same piece of code again to generate a summary. However, when the code reaches the line to change the recordset, Access crashes. It does not give an error message - the whole application closes with no warning.
I have tied various things to isolate the problem. It is the piece of code:
Forms!frmCumCharts.RecordSource = ???????
which always causes the crash. ???? is usually a variable containing a SQL string, but even with a very simple SQL or plain table, the result is the same - it crashes.
I can't understand why the code works for the initial opening of the form, but crashes so catestrophically when trying to do it a second time.
Anyone have any ideas?
Aidan Hughes
I have a form which shows various levels of information depending on parameters selected by a user. A recordset is generated, form opened in design view, recordset and various other bits changed, form saved and opened in normal view - everything is fine.
I have another button on the opened form. This closes the form and runs the same piece of code again to generate a summary. However, when the code reaches the line to change the recordset, Access crashes. It does not give an error message - the whole application closes with no warning.
I have tied various things to isolate the problem. It is the piece of code:
Forms!frmCumCharts.RecordSource = ???????
which always causes the crash. ???? is usually a variable containing a SQL string, but even with a very simple SQL or plain table, the result is the same - it crashes.
I can't understand why the code works for the initial opening of the form, but crashes so catestrophically when trying to do it a second time.
Anyone have any ideas?
Aidan Hughes