GrezMnky
10-12-2004, 11:17 AM
Forgive me if I have posted this previously, but this problem continues to plauge me.
(I have changed the names of my fields and tables for confidentially reasons and although it does look like the nortwind db, it's not)
I have a main form (ORDERS). I have a subform (ORDERDETAILS) in form ORDERS. In that subform is a combox (FOODITEM). The row source for FOODITEM is a table "FOODS" which has several fields like FOODID,TYPE (ie Veggies, Meats, Candies, etc), PRICE, WEIGHT, etc. The control source for the combox is in the table MAIN and it is storing the value of FOODID. The LimitToList property is set to YES for the combox. If I enter something in FOODITEM that is not in the table FOODS already, the form triggers the NotInList event and asks me if I want to add the new item to FOODS. After pressing yes, I can continue entering the rest of the data in the subform for that particular record. During the process for adding the new item, I only ask the user to enter a new description, not the PRICE, WEIGHT etc bc it would be too cumbersome to do at this point. So what I did was create a button on the mainform that would open a form (EDITFOODS) based on the table FOODS so I can edit the PRICE, WEIGHT, etc info for the new item or simply add a new set of items.
Now the subform ORDERDETAILS displays the values, PRICE, WEIGHT etc for each of the FOODS in the FOODITEM combox by way of several other comboxes. For instance, the PRICE combox in the ORDERDETAILS subform, has its control source as MAIN.FOODID. The row source is then a query on the table FOODS such as:
SELECT FoodsID, Price
FROM Foods
and the WEIGHT combox row source is
SELECT FoodsID, Weight
FROM Foods
The problem is, that after I close the form EDITFOODS, the comboxes for PRICE, WEIGHT, etc do not update to show the new data I just entered despite adding Me.Refresh and Me.requery or Me.Recalc statments to the FormClose event in EDITFOODS. I have tried these for the main and subform. Maybe I did it incorrectly? The only way I can get the comboxes to update is to either close the form and reopen or take the form to design view and then back to the datasheet view of the form.
Completely befuddled.
(I have changed the names of my fields and tables for confidentially reasons and although it does look like the nortwind db, it's not)
I have a main form (ORDERS). I have a subform (ORDERDETAILS) in form ORDERS. In that subform is a combox (FOODITEM). The row source for FOODITEM is a table "FOODS" which has several fields like FOODID,TYPE (ie Veggies, Meats, Candies, etc), PRICE, WEIGHT, etc. The control source for the combox is in the table MAIN and it is storing the value of FOODID. The LimitToList property is set to YES for the combox. If I enter something in FOODITEM that is not in the table FOODS already, the form triggers the NotInList event and asks me if I want to add the new item to FOODS. After pressing yes, I can continue entering the rest of the data in the subform for that particular record. During the process for adding the new item, I only ask the user to enter a new description, not the PRICE, WEIGHT etc bc it would be too cumbersome to do at this point. So what I did was create a button on the mainform that would open a form (EDITFOODS) based on the table FOODS so I can edit the PRICE, WEIGHT, etc info for the new item or simply add a new set of items.
Now the subform ORDERDETAILS displays the values, PRICE, WEIGHT etc for each of the FOODS in the FOODITEM combox by way of several other comboxes. For instance, the PRICE combox in the ORDERDETAILS subform, has its control source as MAIN.FOODID. The row source is then a query on the table FOODS such as:
SELECT FoodsID, Price
FROM Foods
and the WEIGHT combox row source is
SELECT FoodsID, Weight
FROM Foods
The problem is, that after I close the form EDITFOODS, the comboxes for PRICE, WEIGHT, etc do not update to show the new data I just entered despite adding Me.Refresh and Me.requery or Me.Recalc statments to the FormClose event in EDITFOODS. I have tried these for the main and subform. Maybe I did it incorrectly? The only way I can get the comboxes to update is to either close the form and reopen or take the form to design view and then back to the datasheet view of the form.
Completely befuddled.