Requerying a form

G

Guest

Hi, I have a main form with several tabs each going to a subform. One
subform shows all of the land parcels that make up the property that is being
looked at on the main form. To add a new property a button must be pressed
and a new free floating form opens up and the user can enter in the new land
parcel info on this free floating form. My problem is that once the user
saves and closes this standalone form the new land parcel does not show up on
the subform on the main form. If I go to the next property and then come
back to this property then the new information shows up.

How do I get the information from the free floating form automatically
update the display in this subform. I tried to make it so that the subform
is requeried when the free floating form is closed but all I get is an error
message saying that it can't find that form ( can't find the main form
either). Any suggestions would be greatly appreciated.

Thanks! Blair
 
J

Jeff Boyce

Blair

The data actually lives in the underlying tables, not the forms.

Your main form/subform may not "know" that the underlying data has been
updated. Are you requerying the subform or main form after updating?

Regards

Jeff Boyce
<Office/Access MVP>
 
G

Guest

Hi, thanks for your response. I have been trying to requery the subform. I
think the problem is I'm just not sure where to write the code. I have tried
just me.requery in the subform's After Update event. I have tried lots of
other places too! I think it makes sense to put it here but so far nothing
is happening. IS this code not enough or is it in the wrong location? I
have also tried requerying the page that the subform sits on biut this also
does not work. Any help would be appreciated. Thanks, Blair
 
J

Jeff Boyce

When something changes on the main form, you want to use that event to
handle the requery. Your code might look something like:

Me!sfrmMySubformName.Requery

However, if your subform is correctly connected to your main form (with
parent/child fields), the subform should refresh itself. What values do you
have in the Parent and Child properties of the subform control on the main
form?

Regards

Jeff Boyce
<Office/Access MVP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top