subform requery

A

Alain Bourgeois

Dear all,

I am using access 2003 SP3. I have troubles showing correct records in a
subform.

I have a form x with a subform y, based on a child table t.
Subform y is continuous, user may not change/ add /delete.
I have a button on x, opening a continuous editable form FEdit based on
table t.

On a close button in FEdit , I set:
Forms!x!y.Form.Requery


However,
* updating a row: works ok
* adding a new row is not shown in subform, even after executing
Forms!x!y.Form.Requery
* deleting a row shows values in subform as #Deleted#

I also tried calling Forms!y.Requery / refresh / repaint,
forms!x!y/requery: same problem.

Does someone have the solution?

Regards,
Alain
 
J

Jeanette Cunningham

Alain,
to requery the subfrom, a specific syntax is required.

DoCmd.Me.[SubformControl].Form.Requery is the code for the delete button

The subform y is inside a subform control.
Your code must use the name of the subform control, not the name of the
subform.

Here is an explanation about suforms I posted a couple of days ago to
someone else.

Open the parent form in design view.
Click only once on the subform - you should see black handles around the
edge of it - the same as if you clicked a textbox, combo, image control etc.
Then click on it again, the black handles disappear.

The black handles are on the edge of the subform control.
The second click takes you into the subform itself.

Click on the main form then click once on the subform control and see the
black handles.
Look on the Other tab and find the name of the subform control.
It might be called Child followed by a number, or it may have a different
name.
Have a look on the property dialog on the Data tab, you should see Source
Object at the top of the list.
The Source Object gives you the name of the form that is currently in the
subform control.

You can swap different subforms into the same subform control ( more
advanced stuff)

Jeanette Cunningham
 
E

Eligio Morgado

Hi!

I have the same problem as you.

Please, can you give me an idea about the solution?

Thanks in advance.
 

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