Nothing is sweeter than one line of code to replace multiple lines. My way of doing this was to save the bookmark, requery the form and then restore the bookmark. This is way better and less code. Better to just create a function all together and reuse. Function requery_in_place(form_name as string) Forms!form_name.recordset.requery End Function And then invoke/call the function in the form as: requery_in_place(me.name) or outside the form as: requery_in_place(form_name) Thanks so much for sharing ❤.
Thanks Rick for the useful tips. My way of re-querying CustomerListF form involves the following simple VBA code. Which can be added to the On Close event in the CustomerF form: If CurrentProject.AllForms("CustomerListF").IsLoaded Then Forms!CustomerListF.Recordset.Requery End If This way if the CustomerListF is active in the background, it will get requeried. If not, the requery command will not fire. Thank you again for the video
Yep. I've covered IsLoaded in a few of my Developer videos, and I made a function out of it for my Code Vault. I plan on covering this in a future TechHelp video too.
Excellent tip. This works on datasheets too. If there are tons of records, I may want to requery only if the user actually changed data in the record to improve performance. And that's a bit tricky to do.
Thanks, Excellent Tip! If you use a Dialog Form, you can also requery the Form after the OpenForm method call. Private Sub OpenCustomer() If IsNull(CustomerID) Then Exit Sub DoCmd.OpenForm "CustomerEditF", , , "CustomerID=" & CustomerID , , acDialog Me.Recordset.Requery End Sub (Only works with a Dialog Form)
This is great! Never knew it could be so easy. However, it's not working on my forms that are running a passthrough query to SQL server. Is there a way to make it work in this scenario?
Does it only work for continuous form? I am trying to requey single form but it doesn’t work. Form is opened on double click event to add options and code is close button of pop form
I am a Gold Member of your Computer Learning Zone and I need to ask you a question about a problem I am trying to figure out in Access. What is your email address?
Nothing is sweeter than one line of code to replace multiple lines.
My way of doing this was to save the bookmark, requery the form and then restore the bookmark.
This is way better and less code.
Better to just create a function all together and reuse.
Function requery_in_place(form_name as string)
Forms!form_name.recordset.requery
End Function
And then invoke/call the function in the form as:
requery_in_place(me.name) or outside the form as:
requery_in_place(form_name)
Thanks so much for sharing ❤.
Yeah, i've never been a fan of bookmarks
Richard i learn a lot with your videos, thank you men, i am a super fan
Thanks Rick for the useful tips.
My way of re-querying CustomerListF form involves the following simple VBA code. Which can be added to the On Close event in the CustomerF form:
If CurrentProject.AllForms("CustomerListF").IsLoaded Then
Forms!CustomerListF.Recordset.Requery
End If
This way if the CustomerListF is active in the background, it will get requeried. If not, the requery command will not fire.
Thank you again for the video
This is cool. You place the code in the close event of the pop-up form. Thanks for sharing.
Yep. I've covered IsLoaded in a few of my Developer videos, and I made a function out of it for my Code Vault. I plan on covering this in a future TechHelp video too.
Another excellent video Richard I have learnt so much from just tech help videos alone
Glad to hear it
I had totally forgotten how to do this! THANK YOU for this video!
You're welcome welcome
Excellent tip. This works on datasheets too. If there are tons of records, I may want to requery only if the user actually changed data in the record to improve performance. And that's a bit tricky to do.
Yep!
Thanks, Excellent Tip!
If you use a Dialog Form, you can also requery the Form after the OpenForm method call.
Private Sub OpenCustomer()
If IsNull(CustomerID) Then Exit Sub
DoCmd.OpenForm "CustomerEditF", , , "CustomerID=" & CustomerID , , acDialog
Me.Recordset.Requery
End Sub
(Only works with a Dialog Form)
Excellent Video!!! Also glad to see you are a fan of both TNG and Rush.
Absolutely... my first concert (ever) was Roll the Bones
Pls i need help my form details are not displaying when viewing after queries in ms access I need help.thanks
This is great! Never knew it could be so easy. However, it's not working on my forms that are running a passthrough query to SQL server. Is there a way to make it work in this scenario?
599cd.com/ask
Very nice and thank you. This unfortunately does not work if your backend is passthrough query based on SQL server sotred procedure.
Sounds about right
Does it only work for continuous form? I am trying to requey single form but it doesn’t work. Form is opened on double click event to add options and code is close button of pop form
It should
Very useful layout
thanks
Great Rost. But instead of a custom form , I just set a flag in the customer detail form.
Cool beans whatever works for you
Thank you sir
Welcome
Awesome 👌
Thanks
I am a Gold Member of your Computer Learning Zone and I need to ask you a question about a problem I am trying to figure out in Access. What is your email address?