A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update a Different Table Field From SFRM's Control AfterUpdate



 
 
Thread Tools Display Modes
  #1  
Old February 6th, 2007, 01:51 PM posted to microsoft.public.access.forms
Andy
external usenet poster
 
Posts: 24
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.