Dlookup

  • Thread starter Thread starter adriany
  • Start date Start date
A

adriany

like to use Dlookup!

can anyone direct me to website or example of Dlookup i
can take a look. thanks
 
Access 97 had the following as examples:

The following example returns name information from the
CompanyName field of the record satisfying criteria. The
domain is a Shippers table. The criteria argument
restricts the resulting set of records to those for which
ShipperID equals 1.

Dim varX As Variant
varX = DLookup("[CompanyName]", "Shippers", "[ShipperID]
= 1")

The next example from the Shippers table uses the form
control ShipperID to provide criteria for the DLookup
function. Note that the reference to the control isn't
included in the quotation marks that denote the strings.
This ensures that each time the DLookup function is
called, Microsoft Access will obtain the current value
from the control.

Dim varX As Variant
varX = DLookup("[CompanyName]", "Shippers", "[ShipperID]
= " _
& Forms!Shippers!ShipperID)

The next example uses a variable, intSearch, to get the
value.

Dim intSearch As Integer, varX As Variant
intSearch = 1
varX = DLookup("[CompanyName]", "Shippers", _
"[ShipperID] = " & intSearch)

HTH

Byron
 
Type DLookUp in the code window (VBE-window, press Alt + F11 to open it when
Access is opened.

Type DLookUp anywhere in VBE-windoe. Set cursor anywhere in word "DLookUp"
and press F1. Now will the helpfiel open up showing help for DLookUp.

// Niklas
 
Back
Top