Hi there,
Many thanks for the replies. However, I couldn't get my form to work following Matt's example, which I worked through, and I couldn't work out what to do from Agni's reply, as I'm not a coder! Maybe I should give more detail about what I'm trying to do.
The first view of my form, Select, has a maximum of 7 hierarchical fields that can be entered by the user and then used to access the database table. For example, "Project" is the highest level field. If the user queries the database table using only "Project", all records for the selected project are returned. The next level is "Subproject". If the user queries the database using "Project" and "Subproject", all records for the subproject within the project are returned.
The records returned from the database are displayed in the second view, Summary, in a repeating table. This shows a snapshot of the records returned from the database, with only certain fields displayed. The user can click a "View" button to show the details of a particular record in the third view, Detail. The button is displayed alongside each record in the table. When the button is clicked, I'm setting the query fields to the values returned for the selected record and requerying the database.
The third view, Detail, shows the full record. I want a button on this view that allows the user to return to the Summary view showing all of the records that were originally returned. But, because I have changed the values of the query fields when moving from the Summary to Detail view, this currently only displays the record from the Detail view on the Summary view.
I've tried using the main database table defined as a secondary data connection in both the Summary and Detail views, but it makes no difference because I still need to set the query fields before moving from the Summary to Detail view.
The main difference between my form and Matt's example is the selection screen. My selection screen allows the user to determine which records to display in the Summary view, whereas Matt's example shows a list of all records in the database table, from which the user selects a record by clicking "View Details".
I think I need to hold the original values of the query fields, as entered by the user on the Select view, and use them to requery the database when moving from the Detail to Summary view. This is where I'm having problems!
Any further help would be appreciated.
Many thanks,
Pete