Want same table in Single Form and Subform Datasheet

W

WDSnews

My form shows a half dozen important fields which easily fit on the form in
'Single Form' format. I'd like to add a datasheet subform showing the same
table the parent form shows. As I move from record to record on the parent,
I'd like to see the subform record marker move up and down. As I move up
and down on the subform, I'd like to see the parent track along with the
correct record.

How can I do this?
 
W

WDSnews

This almost works for me. Unfortunately, clicks cause things to jump around
unpredictably. There are some other controls on the form that may be
messing things up. Particularly, I've implemented your correlated tables
suggestion on this form. So on the parent form (Titles), we have a subform
(sbfTitles) pointing to the same parent data as described below. We also
have a child table (Barcodes) and grandchild table (Transactions) using the
correlated technique on an unvisible field.

When I first brought up the form, after adding the 'Current' event bookmark
procedure below, all seemed well. I used the standard record navigation
buttons at the bottom of the form. But then I clicked on the child table
(Barcodes) to navigate it and see the results in the grandchild table
(Transactions). From that point on, a click anywhere might or might not
cause the sbfTitles datasheet to jump to a different record. Even if I
clicked on the ID field of the parent, the sbfTitles datasheet might jump to
a completely unrelated record.

The parent form (Titles) gets its data from the table. The subform
(sbfTitles) uses a query to get the same data. I assumed this would be OK
so long as the ID fields match. Is that not true?

What might cause this?
 
W

WDSnews

It was my fault. I was referencing the wrong ID field from the subform.
Now it works great.

So now I'm able to navigate both/either the parent or the sbfTitles. I can
see the barcodes, navigate them, and I can see all the transactions for any
barcode. Very powerful. Thanks for all your help.

I hope to learn a few more tricks and I'll be most of the way along with
Access as I had been with ObjectPal.



WDSnews said:
This almost works for me. Unfortunately, clicks cause things to jump
around unpredictably. There are some other controls on the form that may
be messing things up. Particularly, I've implemented your correlated
tables suggestion on this form. So on the parent form (Titles), we have a
subform (sbfTitles) pointing to the same parent data as described below.
We also have a child table (Barcodes) and grandchild table (Transactions)
using the correlated technique on an unvisible field.

When I first brought up the form, after adding the 'Current' event
bookmark procedure below, all seemed well. I used the standard record
navigation buttons at the bottom of the form. But then I clicked on the
child table (Barcodes) to navigate it and see the results in the
grandchild table (Transactions). From that point on, a click anywhere
might or might not cause the sbfTitles datasheet to jump to a different
record. Even if I clicked on the ID field of the parent, the sbfTitles
datasheet might jump to a completely unrelated record.

The parent form (Titles) gets its data from the table. The subform
(sbfTitles) uses a query to get the same data. I assumed this would be OK
so long as the ID fields match. Is that not true?

What might cause this?
 

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