Form recordset question

G

Guest

Hello Mr. Goldgar,

Wow, very good. That fixed the problem. Your code makes the form do what I
want it to do.

I understand exactly how the code works.

If you could though, explain what the northwinds Orders example is doing,
and how it is different? I'm confused because looking at the form:blush:rders, it
really seems to be just navigating through the tables. How am I missing the
part about the form going into "edit mode"?

thanks,

phill
 
D

Dirk Goldgar

phillip9 said:
Hello Mr. Goldgar,

Wow, very good. That fixed the problem. Your code makes the form do
what I want it to do.

Very good.
I understand exactly how the code works.

Even better! :)
If you could though, explain what the northwinds Orders example is
doing, and how it is different? I'm confused because looking at the
form:blush:rders, it really seems to be just navigating through the
tables. How am I missing the part about the form going into "edit
mode"?

On the Northwinds Orders form, you are adding or editing an order
record. Each order has a customer, an order date, a shipping address,
and other information, plus of course the various items that are being
ordered, which are displayed in the subform. The main form also shows
the address information from the Customers table, which may not be the
same as the shipping address. It does this by virtue of its
recordsource query, which joins the Customers table to the Orders table
and includes the address fields from the Customers table along with the
fields from the Orders table.

When you select a customer in the CustomerID combo box, you are *not*
moving the Orders form to a new record. What you are doing is setting
or changing the customer for whom this order was made. When you do
that, the form's underlying recordsource query automatically looks up
the customer-address information so that it can be displayed on the
form, but that's not because you moved to a new order record; it's just
that the recordsource query is performing an "auto-lookup" (by virtue of
the join on the tables) to get the address information that matches the
customer you selected.

As it happens, code in the combo box's AfterUpdate event initializes the
order's shipping address to the address that is on file in the Customers
table for that customer, but that can be overridden manually.
 

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