|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
With respect to the previous thread that was posted, there's a problem. From the subform (parts_sent_info), we have the combo box (part no) to lookup the weight from the table (weight_of_parts). I need to capture this weight in 2 tables, "Order_fulfulment"(which constitutes the main form) and "parts_sent_info". But the corresponding entries in these 2 tables for the field "weight" is not updated. Anyone who can help? Regards, Tracy |
|
#2
|
||||
|
||||
|
You have several options to write the data into the table.
Use the OnChange or AfterUpdate events of the combo and using DAO or SQL you can write the value you selected from th combo, into the table. Knowing the field names i can be more specific.
__________________
BRegs, TBÁrpi "I can only show you the door. You're the one who has to walk through it." |
|
#3
|
|||
|
|||
|
I managed to come up with an update query to update the field "weight" in the table "Parts_sent_info".
In the subform (Parts_sent_info subform), the fields are: PacRef(not visible), No, PartSentNo, Weight, Quantity with a command button that runs the update query which goes like this: UPDATE PARTS_SENT_INFO, ORDER_FULFULMENT, WEIGHT_OF_PARTS SET PARTS_SENT_INFO.WEIGHT = [FORMS]![PARTS_SENT_INFO_SUBFORM]!WEIGHT WHERE ([PARTS_SENT_INFO].[PARTSENTNO]=[FORMS]!PARTS_SENT_INFO_SUBFORM!PARTSENTNO And [FORMS]![PARTS_SENT_INFO_SUBFORM]!PARTSENTNO=[WEIGHT_OF_PARTS].[PARTNO]); It works fine...it's just that whenever i click on the command button, it pops out a window for me to input the [FORMS]![PARTS_SENT_INFO_SUBFORM]!WEIGHT and another popup to input FORMS]!PARTS_SENT_INFO_SUBFORM!PARTSENTNO. Why is this so? And how do i change this query in order to have it updated automatically once the command button is clicked? Regards, Tracy |
|
#4
|
||||
|
||||
|
Refer the subform's control like this:
Me.[subform_control_name].Form.[control_name] where: - 'Me' is the keyword referring the current (parent) form the code belongs to - [subform_control_name] is the name of the subform control on your parent form - [control_name] is the name of the control on your subform referred by [subform_control_name]. Example: If the name of the subform control on your parent form is 'Parts_sent_info_subform' then: Me.Parts_sent_info_subform.Form.WEIGHT In your SQL statement, you need to concatenate the SQL keywords with the VALUES eld by the controls, and NOT with the controls themselves. To concatenate them, use the '&' operator. The '&' operator is used for string concatenation. See Help for more information on using the '&' operator. Last edited by TBÁrpi : February 11th, 2004 at 04:48 AM. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Updating corresponding field in table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|