Refresh/requery subform after data added (1 Viewer)

billyr

Registered User.
Local time
Today, 16:33
Joined
May 25, 2003
Messages
123
On my main form are 2 cascaded CBOs. The "notinlist" event of the 2nd triggers code to add the new record. The subform should then display (via link) the new record for continued editing.
The new record is NOT displayed in the subform without first reselecting the added record.
If an existing record is selected the subform works great ie it immediatedly links to the selected record.
I have tried various requery statements to no avail. This must be one of those obvious ones I just WILL NOT see. Help (again). Thanks in advance.
 
Billyr,

Is you subform based on a query, or the Master-Child links?

If it is a query, then you Must do a requery after adding the
new record.

If you use the links, then you can programmatically do a

DoCmd.GoToRecord acActiveDataObject, , acNext

followed by:

DoCmd.GoToRecord acActiveDataObject, , acPrevious

Wayne

edited - I only need one name ...
 
Thanks for the help. I tried your idea to no avail. The problem is fixed. The subform is now based on a stored parameter query that uses the main form CBO selection as criteria. The subform immediately displays the selected or newly added record.
 

Users who are viewing this thread

Back
Top Bottom