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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populate order items

Status
Not open for further replies.

etcrier

Programmer
Sep 20, 2006
60
US
I know i have seen solution somewhere on this board but i can not find it.
i have a transaction subform in an order form for sales.
the subform lists all the items purchased.
i have a inventory file with items in it - item#, description, price, etc.

how do i on the subform enter just the item# and have the other fields filled in from the inventory file. then I just enter quantity and extend price for each item of a continious sub form inside an order form.

thanks
 
You try to use the DLookup method on the After Update event of your Item # field:

Private Sub Item#_AfterUpdate()
On Error GoTo Err_ProductID_AfterUpdate

Dim strFilter As String
strFilter = "Item# = " & Me!Item#

Me!Description = DLookup("Description", "Inventory", strFilter)
)

Exit_Item#_AfterUpdate:
Exit Sub

Err_Item#_AfterUpdate:
MsgBox Err.Description
Resume Exit_Item#_AfterUpdate

End Sub
 
oops!!!
On Error GoTo Err_ProductID_AfterUpdate
should be
On Error GoTo Err_Item#_AfterUpdate
 
how this code know which fields in the inventory file to populate to the order file
must the fields names be the same in both
or do i drag a relationship line for each field in each file?

thanks for your trouble helping me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top