Hi,
I have a load module which pulls a recordset, then loads a form from.
Every now and then, very randomly, when i launch my db (still in development) it gives me an error saying that there are no records.
This a portion of the code
The .MoveLast is the line that gets highlighted by the debugger.
This is quite strange, as this module isn't even being called on launch.
Any help would be appreciated
*EDIT* Ok, i've just put a msgbox at the begining of the module, and it is being run whenever i launch my main menu. (The begining of my db) Is there some way to stop this? The problem is that the rst in the above code is created by a sql statement that has a WHERE statement which shouldn't be set yet, and I have initialation code setting that value to 0. So when the module runs without being called it is setting the recordset to NULL essentially.
so basically i need to stop the module running unless it is actually being called
I have a load module which pulls a recordset, then loads a form from.
Every now and then, very randomly, when i launch my db (still in development) it gives me an error saying that there are no records.
This a portion of the code
Code:
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
With rst
.MoveLast
If .RecordCount > 1 Then
.MoveFirst
The .MoveLast is the line that gets highlighted by the debugger.
This is quite strange, as this module isn't even being called on launch.
Any help would be appreciated
*EDIT* Ok, i've just put a msgbox at the begining of the module, and it is being run whenever i launch my main menu. (The begining of my db) Is there some way to stop this? The problem is that the rst in the above code is created by a sql statement that has a WHERE statement which shouldn't be set yet, and I have initialation code setting that value to 0. So when the module runs without being called it is setting the recordset to NULL essentially.
so basically i need to stop the module running unless it is actually being called
Last edited: