RequeryRecords on Summary View (1 Viewer)

SharePoint.Gurus

New member
Local time
Today, 11:16
Joined
Feb 21, 2015
Messages
6
Is it possible to use the RequeryRecords action during the OnLoad event for a summary form?

I'm having problems with specifying the "Where" clause. No matter what syntax I used, I get the message "Invalid Field". The data source for the form is a view of a single table.

I've been able to use the RequeryRecords action on a list view.
 

AccessJunkie

Senior Managing Editor
Local time
Yesterday, 18:16
Joined
May 11, 2006
Messages
278
Hi,

The short answer to your question is no, it is not possible to use RequeryRecords macro action in the On Load event of a summay view in an Access 2013 web app.

Now let me explain why.

Imagine in a list or blank view you use the RequeryRecords macro action to requery the records and return a different subset of records using the Where argument.

The syntax would be something like:

[FieldNameHere]=[NameOfTableHere].[FieldNameInThatTable]

If the view you are using is based on a saved query as it's record source, then you must use the query name like this:

[FieldNameHere]=[NameOfQueryHere].[FieldNameInThatQuery]

One thing to note which sometimes trips people up is that this technique won't work if the view you are using has an Embedded Query as its record source. The reason for this is you have no way of knowing what the embedded query name is that Access creates behind the scenes for the Access 2013 web app view. (It's actually a GUID name behind the scenes.)

For all summary views, Access generates a hidden system query to drive it, even if you base the summary view off a saved query. The hidden one will not be exposed and I think it has some GUID name for it. So that means I don't believe you can use RequeryRecords with a Summary view if you are trying to use a Where clause with it.

I even had to add a special troubleshooting note in my book on this since I knew people would get tripped up on this along with OpenPopup and ChangeView macros (Page 584):

TROUBLESHOOTING Why do I get an error trying to use a Where clause with an OpenPopup or ChangeView action when the view is based on an embedded query? Access Services requires the Where clause to include the table or query name on which the view is based. When you define an embedded query as the record source for a view, Access Services creates a hidden system query that is not visible in the Navigation Pane. Therefore, you cannot use a Where clause with the OpenPopup action or ChangeView action to open a view based on an embedded query. To work around this limitation, you can base your view on a saved query object. Note that Access Services creates a hidden system query as the record source also for Summary views. This means that you cannot use the Where clause argument to open a Summary view to a specific record or set of records. However, the workaround mentioned above won't work for Summary views.

Hope that explains the behavior,

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
Senior Content Developer - Modern Assistance and Support Experience - Microsoft Corporation

Author - Microsoft Access 2013 Inside Out
Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010/2013 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/en-us/legal/Copyright/Default.aspx
----------
 

SharePoint.Gurus

New member
Local time
Today, 11:16
Joined
Feb 21, 2015
Messages
6
Thanks Jeff, I suspected that might be the situation, but its good to have it clarified. Great book BTW
 

AccessJunkie

Senior Managing Editor
Local time
Yesterday, 18:16
Joined
May 11, 2006
Messages
278
Hi,

Thanks for the nice comments on my book. I hope you have found it useful in your study of Access 2013 web apps and desktop applications.

Good luck with your continued studies and your web app projects.

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
Senior Content Developer - Modern Assistance and Support Experience - Microsoft Corporation

Author - Microsoft Access 2013 Inside Out
Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010/2013 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/en-us/legal/Copyright/Default.aspx
----------
 

Users who are viewing this thread

Top Bottom