If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Update a Different Table Field From SFRM's Control AfterUpdate
Hi;
Using A2K. Need to update a price in tblPackagedProducts when the price is changed in sfrmProducts. Just finished browsing more than 1500 post subjects. Nothing obvious to me. Have 4 Tbls feeding 2 Frms. frmProductCategory, Record Source = tblProductCategory sfrmProductName, Record Source = tblProductName sfrmProductName contains ProductName, ProductDescription, ProductCost, ProductMarkup, ProductSellingPrice. frmPackagedCategory, Record Source = tblPackagedCategory sfrmPackagedProductName, Record Source = tblPackagedProductName sfrmPackagedProductName contains PackagedProductName, PackagedProductDescription, PackagedProductCost, PackagedProductMarkup, PackagedProductSellingPrice. The user enters products individually in frmProductCategory then in frmPackagedCategory!sfrmPackagedProductName the user can cluster individual products in a "Package". All this works correctly. What the AfterUpdate Event in sfrmProductName![ProductCost] needs to do is that when the user updates the Cost for a product in frmProductCategory!sfrmProductName the updated Cost needs to be "Copied?" into tblPackagedProductName![PackagedProductCost] and same for ProductCost = PackagedProductMarkup & ProductSellingPrice = PackagedProductSellingPrice. Using this Code in AfterUpdate: Dim X As Variant X = DLookup("[PackagedProductName]", "tblPackagedProductName", "[PackagedProductName]= '" _ & Forms![frmProductCategory].Form![sfrmProductName].Form![txtProductName] & "'") If Not IsNull(X) Then Above works correctly. What doesn't work is this next snippet: Tables![tblPackagedProductName].Table![PackagedProductCost] = Me.Forms![frmProductCategory].Form![sfrmProductName].Form![txtProductCost] Would someone be so kind and tell me what is missing? Thank You for taking the time to read this Post. Andy |
Thread Tools | |
Display Modes | |
|
|