| | |
|
|
|
Dlookup |
| message from adriany on 18 May 2004 |
like to use Dlookup!
can anyone direct me to website or example of Dlookup i
can take a look. thanks
|
| Niklas Östergren replied to adriany on 18 May 2004 |
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
"adriany" <anonymous@discussions.microsoft.com> skrev i meddelandet
news:eb4501c43d19$8fb3d2a0$a401280a@phx.gbl...
|
| Byron replied to adriany on 18 May 2004 |
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
|
|
Archived message: Dlookup (Microsoft Access Database)