longestdrive
Programmer
Hi
I have an unbound form displaying record details, this has an underlying recordset and a combo control to enable the user to move through the records. This all works fine.
I have a button on the form for the user to add new records, it pops up a form and the user enters the details, this form is bound to a table and works fine.
The form then closes. Before it closes I then requery the view form and expect to see the combo box updated with the new record but it doesn't update.
Here's the code from my new record form as it closes:
It appears as if the records this form creates does not get 'saved' to it's table until the form is closed completely even though I have saved the form earlier and so as the records aren't there nothing changes on my view form.
I tested this with a break at the requery and the records did not yet exists.
So - some help please.
1. At what point should I requery my view form to ensure the records are there?
2. Why does the save not save the records until the form is closed completely
3. How can I pause code on my calling form until the view form is closed - thinking that once the view form gets control again I can refresh there (change my form to a function??)
Any advice appreciated
Thanks
I have an unbound form displaying record details, this has an underlying recordset and a combo control to enable the user to move through the records. This all works fine.
I have a button on the form for the user to add new records, it pops up a form and the user enters the details, this form is bound to a table and works fine.
The form then closes. Before it closes I then requery the view form and expect to see the combo box updated with the new record but it doesn't update.
Here's the code from my new record form as it closes:
Code:
' save this record first
DoCmd.Save , "frm_new_assessment"
[Forms]![frm_viewAssessments].Form.Requery
[Forms]![frm_viewAssessments].[Form]![cbo_userAssts].Requery
Debug.Print ("user asst requery")
DoCmd.Close
It appears as if the records this form creates does not get 'saved' to it's table until the form is closed completely even though I have saved the form earlier and so as the records aren't there nothing changes on my view form.
I tested this with a break at the requery and the records did not yet exists.
So - some help please.
1. At what point should I requery my view form to ensure the records are there?
2. Why does the save not save the records until the form is closed completely
3. How can I pause code on my calling form until the view form is closed - thinking that once the view form gets control again I can refresh there (change my form to a function??)
Any advice appreciated
Thanks