M
Marcia
I am trying to design a simple inventory database for work. Among my
tables are:
tblCrafts:
fldCraftID (PK)
fldCraftName
fldCurrentSalePrice
tblInventoryTransactions:
fldInvTransactionID (PK)
fldInvCraftID
fldSalePrice
fldQuantity
My problem lies in creating a "static" sale price AT THE TIME I enter
the transaction. My reason for doing this is to assign the current
sale price from tblCrafts to the fldSalePrice in my Inventory table
(when the transaction takes place) that will NOT change if the
fldCurrentSalePrice in my Crafts table is adjusted later.
Based on several postings that I have read from a Google search of the
newsgroups on this subject, I think that I'm supposed to assign the
static value via an "AfterUpdate() Event Procedure." It isn't
working, however -- I'm just getting "$0.00" in the fldSalePrice
field.
My problem may be just technical in nature because I'm really not sure
how the AfterUpdate() event is supposed to work, and I'm very
unskilled at programming; I suspect that I'm not properly referring to
the field names. Here's what I did:
My subform is based on a query that contains the fldSalePrice and
fldQuantity from the Inventory table. Although the tblCrafts table
that contains the current price is linked in the query design, the
fldCurrentSalePrice is NOT in a column... I just wanted to refer to
the field.
In the Design view for my subform, I opened the properties for
fldSalePrice, and entered the following for the AfterUpdate() Event
Procedure:
Private Sub fldSalePrice_AfterUpdate()
Me.fldSalePrice = tblCrafts.CurrentSalePrice * Me.fldQuantity
End Sub
I would really appreciate it if someone could tell me how this is
really supposed to work!
Thanks!!
Jessi
tables are:
tblCrafts:
fldCraftID (PK)
fldCraftName
fldCurrentSalePrice
tblInventoryTransactions:
fldInvTransactionID (PK)
fldInvCraftID
fldSalePrice
fldQuantity
My problem lies in creating a "static" sale price AT THE TIME I enter
the transaction. My reason for doing this is to assign the current
sale price from tblCrafts to the fldSalePrice in my Inventory table
(when the transaction takes place) that will NOT change if the
fldCurrentSalePrice in my Crafts table is adjusted later.
Based on several postings that I have read from a Google search of the
newsgroups on this subject, I think that I'm supposed to assign the
static value via an "AfterUpdate() Event Procedure." It isn't
working, however -- I'm just getting "$0.00" in the fldSalePrice
field.
My problem may be just technical in nature because I'm really not sure
how the AfterUpdate() event is supposed to work, and I'm very
unskilled at programming; I suspect that I'm not properly referring to
the field names. Here's what I did:
My subform is based on a query that contains the fldSalePrice and
fldQuantity from the Inventory table. Although the tblCrafts table
that contains the current price is linked in the query design, the
fldCurrentSalePrice is NOT in a column... I just wanted to refer to
the field.
In the Design view for my subform, I opened the properties for
fldSalePrice, and entered the following for the AfterUpdate() Event
Procedure:
Private Sub fldSalePrice_AfterUpdate()
Me.fldSalePrice = tblCrafts.CurrentSalePrice * Me.fldQuantity
End Sub
I would really appreciate it if someone could tell me how this is
really supposed to work!
Thanks!!
Jessi