View Single Post
  #21  
Old November 5th, 2009, 12:42 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Need guidance for Inventory dbase, want to avoid calculated field.

On Thu, 05 Nov 2009 00:25:03 GMT, "plisvb via AccessMonster.com" u55912@uwe
wrote:

Ok so,

First of all thanks for your help. I'm learning a lot even in my failures.

I believe that I've duplicated what you said to do but it still doesn't work.

I already have a transactions subform which is linked to an overall Orders
(Invoices) form. So I'm trying to implement the solution with what I've
already done.


Forms aren't "linked". Is this in a Subform control? or are you opening the
transactions form using an OpenForm macro or VBA call?

In the Subform I have a dropdown field called "Transaction Item" here's the
code for that field:


A "dropdown field" is properly called a "Combo box". It helps if you use the
Access jargon...

SELECT Inventory.[Item Number], Inventory.Item, Inventory.ID, Inventory.
Discontinued, Inventory.Cost FROM Inventory WHERE (((Inventory.Discontinued)
=False)) ORDER BY Inventory.[Item Number], Inventory.Item;


What's the distinction between the Item Number and the ID? Is each "Item" in
the Inventory table unique? Does it correspond with what I've been calling a
"product"?

I've also created a field called Current Price in my Inventory Transactions
Table and added that field to the subform.

My code for the event update added to the Transaction Item field is the
following:

Private Sub Transaction_Item_AfterUpdate()
Me.Current_Price = Me.Transaction_Item.Column(4)
End Sub


That should work, if there's a textbox (not a field) on the form named
Current_Price.

I'm not exactly sure if I've done something inherently wrong here. If you
could advise, that would be great.



Is it working as you expect, or not? The VBA code looks ok, assuming the
control and fieldnames are correct.
--

John W. Vinson [MVP]