Refresh Sub form (1 Viewer)

Gismo

Registered User.
Local time
Today, 19:17
Joined
Jun 12, 2017
Messages
1,298
Hi All,

I have a few sub forms within a main form with a drop down (unbound) box to select records to display
One of the forms I have a delete button to delete certain records in that form.
when deleted, the record in the sub form shows records deleted.
how do you requery the sub form after deletion if the option to requery the sub form is not available
if i requery on the controls in the sub form it still displays deleted
I just used the on click funtion to delete the record with a query and to requery
 

Rene vK

Member
Local time
Today, 18:17
Joined
Mar 3, 2013
Messages
123
You have to requery the form in the subform.
Code:
With Me![SubForm-Name]
  .Form.Requery
End With
 

Gismo

Registered User.
Local time
Today, 19:17
Joined
Jun 12, 2017
Messages
1,298
You have to requery the form in the subform.
Code:
With Me![SubForm-Name]
  .Form.Requery
End With
do I requery the sub form where I do my edits / deletions or die main form?
I tried requery the sub form , from a macro I does not work
using the code above I get can not find the field but it is a form name
 

Rene vK

Member
Local time
Today, 18:17
Joined
Mar 3, 2013
Messages
123
You are deleting records with a button on a subform? If that is the case you have to go back to the parent Form. (the one with the subforms)
Code:
With Parent![SubForm-Name]
  .Form.Requery
End With

If it's something else we probably should see what you are working on.
 

Users who are viewing this thread

Top Bottom