Please Help! I can't get my SubForm to Display changes in data.

G

Guest

Hi All,

I hope you can help me with this irritating problem. I have a main form
that I will call Mainform. It is linked to a Subform that I will call
Subform through a CoverID field that is in both tables that contain the
Mainform and Subform data. The Subform data is essentially the detail
information of the Mainform Data and is displayed in a Datasheet.

1. I have a button on the Mainform for deleting "marked" records in the
Subform. You check off which records in the Subform you want to delete, then
you click on this button. It deletes the records in the subform, but puts
the words Deleted# in the fields where the record used to be. You have move
to another record and then back to actually get these lines off the subform.
I have tried putting requery code at the end of the Delete procedure, but no
matter how I write it, it doesn't change anything.

2. I have the same type of problem with adding records that are to be
displayed in the subform. You have to move to another record and then back
to see the subform update with new records.

Please help. I am essentially at a loss here and any help you can give
would greatly be appreciated.

Thanks
 
G

Guest

Does your requery act on the mainform or the subform? I think it needs to
directly reference the subform:
Me.sfrmSubform.Form.Requery

HTH,
Barry
 
G

Guest

Well, I have a button control on my mainform that you click to delete records
from the subform. I use the OnClick and have a procedure that runs through
the necessary steps. At the very end of this procedure I have the

Me.sfrmSubform.Form.Requery

But it still does not update the Subform. Am I putting this in the wrong
place?

I have not worked with Subforms very much and this particular project is
full of them. But it's these little things that are hanging me up....it's
frustrating.

Thanks,
Kathy
 
G

Guest

Instead of requery, try refresh. If that doesn't help, I'm afraid I'm out of
ideas.

Barry
 
G

Guest

I am by no means an expert but was just trying to figure out the same
problem, but was actually able to come up with an idea that worked...i think.

Me!sfrmSubform.Form.Requery

Hope it helps,
Greg
 
G

Guest

Hi All,

Thanks for all your help, but none of this seems to be working. If I can
figure it out I will definitely let all of you know!!!

In the meantime, if anyone has another idea for me to try, I would greatly
appreciate it.

Thanks so much,
Kathy
 

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