Requery in Place: How to Requery a Continuous Form in Microsoft Access Without the Focus Moving

preview_player
Показать описание
In this Microsoft Access tutorial, I'm going to teach you how to requery a continuous form in place so that the data updates but the focus doesn't move. We will use an On Got Focus event with a Me.Recordset.Requery, and I'll also show you how to make a custom edit form with a Close event to do the same thing, but is better for large datasets.

Damaris from Milwaukee, Wisconsin (a Platinum Member) asks: I have a continuous form much like your customer list form, however because I have some aggregate functions in there, it's not updateable. I can made it so I can double click to open up a single form where I can edit records individually but then when I return back to the continuous form the data doesn't update. And if I issue a requery command, it puts me back up at the top of the list. Is there any way to refresh that form and update the data without the focus moving?

Silver Members and up get access to an Extended Cut of this video. Members will learn how to edit data in a non-updateable continuous form in place using one of my secret special tricks. Curious as to what the trick is? Join today!

MEMBERS VIDEO:

BECOME A MEMBER:

LEARN MORE:

PRE-REQUISITES:

LINKS:

THE CODE:
Me.Recordset.Requery

RECOMMENDED COURSES:

FREE TEMPLATE DOWNLOADS:

ADDITIONAL RESOURCES:

KEYWORDS:
access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, Retain position on continuous form through requery, Refresh or requery, Form.Refresh, Form.Requery, refreshing or requerying a continuous form, Restoring a continuous form after Requery, Requery a Form in Place, Form.Recordset.Requery, requery a single record in a continuous form microsoft access, edit non-updateable form in place

QUESTIONS:
Please feel free to post your questions or comments below. Thanks.
Рекомендации по теме
Комментарии
Автор

Richard i learn a lot with your videos, thank you men, i am a super fan

robertodc
Автор

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)

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 ❤.

navisalomi
Автор

I had totally forgotten how to do this! THANK YOU for this video!

InterpretNZ
Автор

Another excellent video Richard I have learnt so much from just tech help videos alone

michael
Автор

Excellent Video!!! Also glad to see you are a fan of both TNG and Rush.

tomlarussa
Автор

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.

rabidfollower
Автор

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 Then



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

sager
Автор

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?

ourfamilygarden
Автор

Very nice and thank you. This unfortunately does not work if your backend is passthrough query based on SQL server sotred procedure.

schwanabdulkareem
Автор

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

muhammadasadkhan
Автор

Pls i need help my form details are not displaying when viewing after queries in ms access I need help.thanks

peteremmanuelololade
Автор

Great Rost. But instead of a custom form, I just set a flag in the customer detail form.

balaboopathy
Автор

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)

xavierbatlle
Автор

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?

wirelessg