Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 7th, 2005, 10:57 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: , , United Kingdom.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Default Requery Subforms


I have 3 tables, tbl_Records, tbl_Clients and tbl_Salesperson where tbl_Records is my main table. tbl_Clients and tbl_Salsperson are enforced to tbl_Records (1 Client,Salesperson to many Records)

I have built a form with 2 subforms displaying the client and salesperson data for each Record. The Subforms are purely for display purpose and are read only. The data comes from two other pop up forms. The pop ups return record IDs to the main form and store them in the Foreign Key fields. The idea is that the subforms then get requeried to display the correct record.

My problem is that I cannot requery either subform until both subforms have been populated with data. Error 3201, "Related record required in ... ". Is there anway I can requery the individual subforms wihtout having to populate them both first?
  #2 (permalink)  
Old January 7th, 2005, 11:05 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I am wondering if there is a property that you can change in the relationships between the tables that will show all records, but only salesperson or client data where the two are equal?

I could be wrong though...

Mike

Mike
EchoVue.com
  #3 (permalink)  
Old January 7th, 2005, 11:13 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: , , United Kingdom.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Mike

You are correct, I can remove referential integrity form the relations and then the forms do requery. However, I then lose the ability to cascade delete when say a client is deleted from the database. I suppose I could build queries to remove related records but I was hoping to keep enforced relations and minimize the number of database components / Work!
  #4 (permalink)  
Old January 13th, 2005, 07:40 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: , , United Kingdom.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Found a solution!

By simply putting text controls onto the main form and binding them to the FK's will force a refresh of its related subForm!

Please consider this topic closed.


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you get SqlDataSource to requery? David_0223 C# 2005 6 May 26th, 2008 11:49 AM
Requery a subform aware Access 3 December 27th, 2005 12:25 PM
Requery SubForm lizhaskin Access 1 November 28th, 2005 02:19 PM
rsSearch.Requery Lucian Ion Dreamweaver (all versions) 5 July 5th, 2005 07:54 PM
requery subform bpete Access VBA 5 March 30th, 2004 09:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.