Forms and Subforms

G

Guest

I've got a form [Vendor] along with a subform ([Contract], which will list
each contract with the corresponding vendor), and everything works fine
except one thing. When I first open the form to either view the data, or I
can input data here as well, the Vendor info comes up but the Contract info
does not. If I click the form (Vendor) navagation button to the next record,
and back to the current record, the Contractor info appears. I can also get
this info to show up if I simply click the A-Z Sort button (Vendor Name is
highlighted on the Vendor form). Once I do either of these above, I can
scroll forward or backward through all my vendor records just fine, but
obviously I would like to see the subform Contract info show in the first
place. I've looked around here but have not found much similar to this.
 
A

Allen Browne

The normal behavior is for the subform to show the records, so something
else must be happening here.

Can we confirm the basics? I will assume:
- The main form is bound to your Vendor table.
- The subform is bound to your Contract table.
- The Contract table has a VendorID field that relates to the primary key of
the Vendor table.
- The Link Master Fields and Link Child Fields properties refer to the
VendorID fields.

If that is all in place, it should work, so you are looking for anything
that could be interferring:
a) Are you using a query as the source for the main form or subform? If so,
does the criteria of the query refer to the form?

b) Is there any code or macro in the form's Open or Load events? In other
events?

The issue with (a) is that you have a chicken'n'egg scenario, where the
query must run so it can load the values into the form, but the form must
have its values in order to run the query.

Likewise, code (issue b) can alter what happens.
 

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