Solved How to refresh sub form - this is not working.... (1 Viewer)

Number11

Member
Local time
Today, 01:56
Joined
Jan 29, 2020
Messages
607
I cannot get the subform to refresh after code is run from button using

iF Me.Dirty Then Me.Dirty = False
Forms![Main_Name].[Sub_Name].Form.Requery

and this does not work either

Me.[Sub_Name].Form.Requery
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:56
Joined
Oct 29, 2018
Messages
21,467
Hi. Where is the button located? On the main form? What info on the subform are you trying to requery?
 

Number11

Member
Local time
Today, 01:56
Joined
Jan 29, 2020
Messages
607
Hi. Where is the button located? On the main form? What info on the subform are you trying to requery?

The button is on the main form and runs a query and then function to add last imported date and time the subform is displaying a query with last run date using the max option to show latest date/time within a list box
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:56
Joined
Oct 29, 2018
Messages
21,467
The button is on the main form and runs a query and then function to add last imported date and time the subform is displaying a query with last run date using the max option to show latest date/time within a list box
Okay, when you say it doesn't work, what exactly do you mean? Are you getting any errors?
 

Number11

Member
Local time
Today, 01:56
Joined
Jan 29, 2020
Messages
607
Okay, when you say it doesn't work, what exactly do you mean? Are you getting any errors?
The sub form does not refresh with the newest date and time, so work around is i close the form and reopen and the data has refreshed so its working fine with that method
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:56
Joined
Oct 29, 2018
Messages
21,467
The sub form does not refresh with the newest date and time, so work around is i close the form and reopen and the data has refreshed so its working fine with that method
Okay, before I ask you to post a demo copy of your db, could you try the following first?

Me.SubformName.Form.Recalc

Thanks!
 

Users who are viewing this thread

Top Bottom