Custom Function

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Please, give me a hint on why the following custom
function does not work:

Option Compare Database

Function BranchName(ID)
BranchName = DLookup_
("[BranchName]", "Branches", "[BranchID]=ID")
End Function

The purpose of the function is to retrieve the full name
of a company branch from "Branches" table.
"Branches" table has 2 columns: [BranchID](text field),
[BranchName](text field)
 
Hi,



DLookup( "BranchName", "Branches", "BranchID=" & ID )

or


DLookup( "BranchName", "Branches", "BranchID=FORMS!FormNameHere!ID" )

if ID is the control on FormNameHere. FORMS is a key word to be typed as it
is.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top