Price Levels

  • Thread starter shannaj via AccessMonster.com
  • Start date
S

shannaj via AccessMonster.com

I have now refined by database to reflect my price levels. I have a
pricelevel table. I have my item list linked by pricelevels, and I have my
customertable linked by Pricelevels. Now I can not figure out how to get
them to look up the correct price in my subform. I know I am doing something
wrong but I can not figure it out. I was using this on my old subform and it
worked great but now that my primary key is an autonumber instead of the
itemid, it is not working properly. I am just not getting the whole Dlookup
function. Here is what was on my old subform. Any one have any ideas? I am
just not sure how to incorporate the pricelevels and customer tables.
rivate Sub ItemID_AfterUpdate()
On Error GoTo Err_ItemID_AfterUpdate

Dim strFilter As String

' Evaluate filter before it's passed to DLookup function.
strFilter = "ItemID = " & """" & Me!ItemID & """"

' Look up product's unit price and assign it to UnitPrice control.
Me!UnitPrice = DLookup("UnitPrice", "tblItemList", strFilter)

' Evaluate filter before it's passed to DLookup function.
strFilter = "ItemID = " & """" & Me!ItemID & """"

' Look up product's unit price and assign it to UnitPrice control.
Me!ItemDescription = DLookup("ItemDescription", "tblItemList", strFilter)

Exit_ItemID_AfterUpdate:
Exit Sub

Err_ItemID_AfterUpdate:
MsgBox Err.Description
Resume Exit_ItemID_AfterUpdate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top