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!

Table/Query corresponding row value

Status
Not open for further replies.

soupisgood84

Technical User
Apr 17, 2007
45
US
Is there a way to get the value of a cell on a specific row by looking up or querying another value on the same row?
Example:
Barcode is a field/column; Serial Number is a field/column.
::::You enter or scan the barcode and the value from the Serial Number field appears in an unbound txtbox.
 
Methods...

1. Use DLOOKUP (see Access Help)

myvalue = DLOOKUP("mycolumn", "mytable", "myid = " & myval)

2. Open Recordset

set rs = currentdb.openrecordset("SELECT mycolumn FROM mytable WHERE myid = " & myval, dbopenforwardonly)

Gary
gwinn7
 
I thought of the Dlookup method, but that will only return the value that you tell it to search, right?
 
Yes.

This is a fairly simple question that can be easily answered more thoroughly by viewing the Help. Its a very quick lookup and there should be at least one example of its usage.

This forum is primarily for helping with specific problems that MAY not be easily answered through simple help lookups.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top