Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2007
    Posts
    102

    Unanswered: Link Master Child Field issue

    Hello,

    This is a tough one (I still speak newbie), an expert may think it's minor league.
    I am trying to replace my Main Order form with a subform because:

    Original form was based on a query of 2 tables (Order and Customers), the subform was based on table OrderDetail(productname, quantity, discount, unitprice). I was experiencing autonumber problems when attempting to start a new order, because of the inner join of Orders and Customers tables. I then changed the query inner join to a a 'left join'...it worked, but broke the rest of the form....
    So I've concluded that I have to figure out how to get the Order data into a new Main Order subform; in which case I would have 2 subforms versus 1.
    The problem is I'm not sure how to connect the 'Link Master and Child fields together, so that the two subforms would 'relate' appropriately in processing an Order.

    Help with suggestions.
    Here is the new Main form's SQL query:
    Code:
    SELECT DISTINCTROW Customers.CustomerID, Customers.FirstName, Customers.LastName, Customers.CompanyName, Customers.BillingAddress, Customers.City, Customers.StateOrProvince, Customers.ZIPCode, Customers.Country, Customers.ContactTitle, Customers.PhoneNumber, Customers.FaxNumber, Customers.Email, Customers.CellNumber
    FROM Customers;
    the first subform is tied directly to the Order Details table, so there's no query. It displays in DataSheet mode. Here are the fields:
    OrderDetailID
    OrderID
    ProductID
    Quantity
    Discount

    the second subform is tied to a query(qryOrderDetail), displays in Form View. based on the Orders table. Here are the fields:
    OrderID
    CustomerID
    EmployeeID
    OrderDate
    PurchaseOrderNo
    ShipName, Shipaddress (more ship info fields)

    this second subform contains the info that didn't work (in the left join) on the original Main form.

    I tried the Link Master on CustomerID, and the Link Child on OrderID in both forms. Got an error "You can't add or change a record because a related record in Orders table is required". Any suggestions or insight would be greatly appreciated. thanks so much.
    Last edited by imrosie; 08-29-07 at 23:32.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •