Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

I am having trouble with 'dlookup'

I am new at this so I apologize for any stupid questions.

Objective: When the user selects a location (Combo box) for an item previously selected, I want dlookup to give me a numeric value (QPC) saved in a other table. All the information is save an a new table.

Row source for item: SELECT Main.ITemID, Main.Description FROM Main;

Row source for location: SELECT Location.Location, Location.Description FROM Location;

Originally, table Main had the numeric value (QPC) saved in the same record as the item. I moved the value to a different table Item_Detail

I will change 15132-0A020 to the value selected but for now I am hardcoding it because I can't get it to work. Also, I have google Error 2465 but I get more confused the more I read.

Private Sub Location_AfterUpdate()
DoCmd.OpenTable "item_Detail"
Me.Units_in_UOM.Visible = True
Me.Units_in_UOM = DLookup([QPC], "Item_Detail", "[ItemId]=15132-0A020")
End Sub

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...