Hi,
I have a problem with a subform turning white when it is refreshed. I've been using Access 2010 and there is no problem but when the database is used in Access 2007, the problem occurs.
I have a database recording several nurseries. I have a form with a subform and when the form opens the subform is programmed to get the number of kids in the selected nursery by month.
This works fine.
I also have the option on this form for the user to click a button to edit details. When they do this, I then call the same code as above to refresh the subform to get the correct details since they have just been edited. The data is kept in sql server and the data is grabbed using stored procedures. So on the onclose event of the form to update the nursery details I call again..
However, when I do this I get the error...
"The expression you entered refers to an object that is closed or doesn't exist."
And then if I click 'End' on the error message, the subform is now completely white.
Does anyone know why this is happening or how to fix it?
If you need anymore of my code, just let me know.
Thanks in advance
I have a problem with a subform turning white when it is refreshed. I've been using Access 2010 and there is no problem but when the database is used in Access 2007, the problem occurs.
I have a database recording several nurseries. I have a form with a subform and when the form opens the subform is programmed to get the number of kids in the selected nursery by month.
Code:
Dim rsNursery As ADODB.Recordset
Set rsNursery = GetKidsPerMonth(nurseryID)
Set Forms![frm_viewNursery].[sub_NurseryKids].Form.RecordSource = rsNursery
This works fine.
I also have the option on this form for the user to click a button to edit details. When they do this, I then call the same code as above to refresh the subform to get the correct details since they have just been edited. The data is kept in sql server and the data is grabbed using stored procedures. So on the onclose event of the form to update the nursery details I call again..
Code:
Dim rsNursery As ADODB.Recordset
Set rsNursery = GetKidsPerMonth(nurseryID)
Set Forms![frm_viewNursery].[sub_NurseryKids].Form.RecordSource = rsNursery
However, when I do this I get the error...
"The expression you entered refers to an object that is closed or doesn't exist."
And then if I click 'End' on the error message, the subform is now completely white.
Does anyone know why this is happening or how to fix it?
If you need anymore of my code, just let me know.
Thanks in advance