Update subform with value from mainform textbox

Gregvg

Registered User.
Local time
Today, 16:15
Joined
Dec 23, 2009
Messages
18
I have a form called CostingForm. This form has a subform called CostingSubform. The subform's data source is a table called Costing Table. The main form has a combobox that has all the "Field names" or headers from the Costing Table that populates with the on open event. I also have a non bound textbox on the main form. What I would like to be able to do is input a value in the textbox, select a field name from the combobox and with an "update" button update the corresponding fields on the subform with the value in the textbox. Is this even possible?
 
Yeah, that's possible, but any need to do that is almost certainly evidence of a table design problem. What are the names of the fields in that table?
 
the fields to update are
Plastic Unit Cost
Plastic Tray Cost
Volume
Live Input Cost1
I am trying to mass update a specific bunch of filtered records on a datasheet with one click as opposed to updating them one at a time.
I was able to do it with an if statement for each field but I was hoping for a cleaner way to do it.
 
Last edited:
Sorry, but it's not clear to me where you are stuck. You are trying to mass update records. OK. And the process you have is not clean enough, is that right? Or it seems tedious to perform?
 
I have a subform that has all the data from my costing table. In that table are about 7 or 8 fields that are not populated when the rest of the table is populated because we don't have all the pricing information needed yet. I am using the main form only to put in the controls. I have 2 fields and an update button on the main form. One is a combo box with all the column headings from the costing table. The other is just a text box. Since the pricing information is not different for each record but can be applied to groups of records my thought process was to be able to filter the subform to represent the records that can be updated, select the column to be updated from the combo box, enter the value in the textbox on the mainform and hit the update button and have that value populate all the records on the filtered form. I can put 7 or 8 if statements to make sure I am updating the correct column unless there is a better way to do it. But my bigger problem is that I am only able to update the current record with the update button. I have tried several loop functions that I saw on this site and others but so far I have been unsuccessful. Any help is appreciated.
 

Users who are viewing this thread

Back
Top Bottom