Form/table odd behavior

M

Monty

I'm troubleshooting for a friend and have run into something I can't
explain and don't recall ever seeing.

He's built a main form with a data source of a table; call it Table1.
The form includes a subform that has a data source of Table2 and is
populated by a select query based on a value in one of the main form
fields.

The odd behavior is that whenever the focus is on the subform, the
main table, Table1, gets updated with a blank record. Has anyone ever
seen this?

TIA
 
J

Jeff Boyce

Monty

I'm not sure you need to use that query to populate the subform. A fairly
standard main form/subform construction displays a parent record in the main
form, uses a subform control in the main form, and displays the "children"
records in the subform. Access provides a way to indicate which field(s) in
main and sub-forms connect the two together.

Or are you saying that the subform does NOT contain child records related to
the displayed parent record?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Monty

I'm not sure you need to use that query to populate the subform.  A fairly
standard main form/subform construction displays a parent record in the main
form, uses a subform control in the main form, and displays the "children"
records in the subform.  Access provides a way to indicate which field(s) in
main and sub-forms connect the two together.

I'm trying to convince him that he should rewrite this function. I
suspect the problem it related to the DoCmd Requery <subform>, but I
don't know enough to say for sure. If he'd write it in VB, I'd be
able to troubleshoot much easier.
Or are you saying that the subform does NOT contain child records relatedto
the displayed parent record?

Right now he doesn't have any child records in the associated table.
I didn't think to go this route because the blank record shows up in
the parent table.

All things considered, I think it may be resolved much quicker if I
just write something more appropriate for him...I'd be willing to be
this is what he had in mind :)

Thanks for you input!
 

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