Requery Problems

choward

Registered User.
Local time
Today, 07:06
Joined
Jan 31, 2008
Messages
39
Hi,

I think this might be quite common but i cant find anything relevant on google.

I have 2 Queries in a form in Table View - one the subform of the other. I want to requery the parent table after updating the child form.

i'm using this VBA code (it doesn't work) :

DoCmd.Requery ([Parent Query])

Any help is appreciated.
 
Perhaps try this in the AfterUpdate evet of the SubForm you did the data entry in:

Forms("MainFormName")("ParentTableSubFormName").Requery


.
 
Thanks Cyberlynx.

Just to make things easier, the main form is called [RAP Manager], the Parent Table (from a query) is called [RAP Courses] (its form is [RAP Courses subform]). The Child Table (from query) is called [RAP Course Demands] (its for is [RAP Course Demands subform])

I have tried this code (if i have understood your code properly):

Forms("[RAP Manager]")("[RAP Courses Subform"]).requery

it doesn't seem to work.

Have i misunderstood?

Thanks,

Chris
 
You don't need the Square Brackets when referencing Forms this way:

Forms("RAP Manager")("RAP Courses Subform").requery

.
 
A couple of things:

1. When referencing the subform you reference the container control name (control that houses the subform on the main form) instead of the subform name. It can be the same as the subform name, but it has to be the container name that is referenced.

2. When requerying the parent form from the subform you don't need to refer to the subform at all.
You would use Me.Parent.Requery
 

Users who are viewing this thread

Back
Top Bottom