I am having trouble with a new subform in a program that has been working just fine. A requirement changed which I felt could be solved by adding this subform (and an underlying Table - "tblSalesRepOrders").
The name of the Main Form is "frmOrders". There are already 3 "tabs" on this form which record the "order details". The new subform is titled "fsubSalesReps". The previous screen could accommodate 1 rep per order; this new program allows more than 1 rep to receive credit for an order.
The underlying query of "fsubSalesReps" is based primarily on "tblSalesRepOrders". The Primary Key of this table is "Territory Code" + "Order#". On "frmOrders" (1) a customer is selected from a list (or created); each customer is assigned a Territory Code. Each Territory Code points to a Sales Rep in "tblSalesReps". (2) The Order# is entered. (3) The subform "fsubSalesReps" is entered and 1 or more sales reps are credited with the order. The 1st control is "TerritoryCode" which is a combo box.
Question #1: How can I create a default Territory Code (i.e. the one that is already assigned to the Customer) that displays on the subform? When I have been able to get this to occur, it appears that the "TerritoryCode" control is still reporting a "null" because I receive the message that a Primary Key cannot include a null field.
Question #2: How do I move the necessary data to controls on this subform (and ultimately to "tblSalesRepOrders"). For example, the commission rate from "tblSalesReps" needs to be saved.
I think my primary problem is that when the cursor is in one Form (e.g. "frmOrders") I am not able to see the controls in the other Form (e.g. "fsubSalesReps"). (I have been trying to do this without using DAO because I think I should be able to.)
Thanks for your help.
The name of the Main Form is "frmOrders". There are already 3 "tabs" on this form which record the "order details". The new subform is titled "fsubSalesReps". The previous screen could accommodate 1 rep per order; this new program allows more than 1 rep to receive credit for an order.
The underlying query of "fsubSalesReps" is based primarily on "tblSalesRepOrders". The Primary Key of this table is "Territory Code" + "Order#". On "frmOrders" (1) a customer is selected from a list (or created); each customer is assigned a Territory Code. Each Territory Code points to a Sales Rep in "tblSalesReps". (2) The Order# is entered. (3) The subform "fsubSalesReps" is entered and 1 or more sales reps are credited with the order. The 1st control is "TerritoryCode" which is a combo box.
Question #1: How can I create a default Territory Code (i.e. the one that is already assigned to the Customer) that displays on the subform? When I have been able to get this to occur, it appears that the "TerritoryCode" control is still reporting a "null" because I receive the message that a Primary Key cannot include a null field.
Question #2: How do I move the necessary data to controls on this subform (and ultimately to "tblSalesRepOrders"). For example, the commission rate from "tblSalesReps" needs to be saved.
I think my primary problem is that when the cursor is in one Form (e.g. "frmOrders") I am not able to see the controls in the other Form (e.g. "fsubSalesReps"). (I have been trying to do this without using DAO because I think I should be able to.)
Thanks for your help.