How To Do A VLookup In Access

Free MS Access VBA Programming Course

This post is in response to this question:

This really doesn’t need any VBA code. It just needs to be setup correctly, and it functions like the VLookup function
in Excel.

In the image, we want to change the “Unit Price” (“PUnitPrice”) value after changing the the “Product Name” (“OProductID”) in the form.

The real key to how to do this is in the way the query is designed, and then you’ll make the form’s recordsource your query.

Here is the structure of “qryOrders”

The dropdown on the form is going to be based on the foreign key

When we use the foreign key, we can “VLookup” necessary items in the main table.

Click here for the database.

Let me know if you have any questions.

Offsite Related Information:

“Go Fund Me” Page

($5 suggested amount)

(…10% of your gift amount will go to charity)

Free! Subscribe To Our YouTube Channel!

Free MS Access VBA Programming Course

Facebooktwitterredditpinterestlinkedinmailby feather