Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfering data from one form to another, but also using criteria

Status
Not open for further replies.

GoinDeep

Technical User
Jan 9, 2003
100
US
I want to transfer data from a field on one form to a field on another. I assume I would use the following to transfer:

ItemID_AfterUpdate:
Me.ItemCharge = Forms!PriceList.ItemCharge

But here is where I am having the problem. PriceList is a continuous form that has ItemID and ItemCharge. So I need to transfer the ItemCharge where the ItemId's match. I was thinking something like this, but appear to be way off:

ItemID_AfterUpdate:
Me.ItemCharge = Forms!PriceList.ItemCharge WHERE "[ItemID]=" & Me![ItemID]

I know WHERE is not the right thing to use, but that is the only way I could explain what I want to accomplish. I hope I made it clear and can get some help on this. Thank you.
 
You could perform a find on your continuous form by setting the focus to the field first and then using FindRecord to navigate to it.

Personally, I would skip all that and use DLOOKUP to get the value you want directly from the table.

Me.ItemCharge = Dlookup("ItemCharge","PriceList", "[ItemID]=" & Me![ItemID])

The above assumes PriceList is the name of the query or table that contains the value you wish to lookup.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top