Custom Function

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)
 
M

Michel Walsh

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top