Requery on continuous subform

ga11ardo

Registered User.
Local time
Yesterday, 23:21
Joined
Sep 26, 2007
Messages
13
I have a subform in which the user enters information about an order that a customer is making. My main form is working correctly; however, I am unable to get my subform to work correctly.

Here is what I need the subform to be able to do:
The user enters the productID, then the unit measures available for purchase for that specific product are requeryed and the unit measure is selected from a combobox. The unit Price and Cost for that product in that unit measure are then filled in. Also, the product description and bin location are filled in after the productID is entered. The user can do this for as many products as they want. The form will also calculate total prices

The problems I am having:

1) Currently I am getting the "The Microsoft Access database engine cannot find a record in the table <name> with key matching field(s) <name>. (Error 3101)" message when I try to go to the second record in the subform. I know why this error is caused by am still unable to fix it.
2) Before I got this error message I had it all working except - when i went to the second record of the subform to enter a second productID and unitmeasure, all the unitmeasure comboboxes would be set to the unit measure i selected for that productID. The prices were then all reset to that unit measure and productID.

I have attached the database and if anyone could please help me fix these problems that I am having and get the subform working as I described I would really appreciate it. (also, I do not know why my subtotal, grandtotal, tax, and shipping and handling calculations are not working. They worked when I had the subform opened independently but not when it is a subform.)
 

Attachments

I have managed to fix most of my problems; however, I have two remaining questions/problems

1) I cannot get the my calculated sum values to work and I have no clue why they are not working. I used =Sum([Quantity]*[UnitPrice]) for the control source but I get the #Name error. (I have another field with the control source of [Quantity]*[UnitPrice] which works properly) Also, the running sum worked when is located in a subform; when the subform was opened independently the sum worked, however, when it is put in the main form it doesn't. Is there anything that has to be added to the sum code when it is located within a subform?
2) I have a dependent combobox in which i want the default value to be the first row, after the combobox is updated. I have used the code =[cboUnitMeasure].ItemData(0) in the default value field. This sets the default value to the first row of the combobox (which is blank) but when the combobox is requeried and updated, the default value does not update to the new first row. How do I get the combobox default value to update when the combobox is requeried off a previous combobox.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom