Advertisement

06.11.2008 at 12:23PM PDT, ID: 23477090
[x]
Attachment Details

DLookup Problem

Asked by rsaphier in Microsoft Access Database

Tags: Microsoft, Access, 2003

I am trying to use DLookup without much success.  What am I doing wrong?  Pertinent info follows....

Dim strDept As String
DimCostCode as string
strDept = "08"

Cost Center is a text field within the table Department and I've tried the following variations all which return a null value.

        strCostCode = DLookup("[Cost Center]", "Department", "[Cost Center] = '" & strDept & "'")
        strCostCode = DLookup("[Cost Center]", "[Department]", "[Cost Center] = '" & strDept & "'")
        strCostCode = DLookup("[Cost Center]", "[Department]", "Cost Center = '" & strDept & "'")
       
        strCostCode = DLookup("[Cost Center]", "Department", "[Cost Center] =" & Chr$(34) & strDept & Chr$(34))
        strCostCode = DLookup("[Cost Center]", "[Department]", "[Cost Center] =" & Chr$(34) & strDept & Chr$(34))
        strCostCode = DLookup("[Cost Center]", "[Department]", "Cost Center =" & Chr$(34) & strDept & Chr$(34))
       
        strCostCode = DLookup("[Cost Center]", "Department", "[Cost Center] =" & strDept)
        strCostCode = DLookup("[Cost Center]", "[Department]", "[Cost Center] =" & strDept)
        strCostCode = DLookup("[Cost Center]", "[Department]", "Cost Center =" & strDept)
Start Free Trial
[+][-]06.11.2008 at 12:25PM PDT, ID: 21763321

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 12:28PM PDT, ID: 21763351

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 12:34PM PDT, ID: 21763402

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 12:35PM PDT, ID: 21763413

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 12:37PM PDT, ID: 21763437

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 12:47PM PDT, ID: 21763523

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 12:52PM PDT, ID: 21763570

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 12:56PM PDT, ID: 21763597

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 01:01PM PDT, ID: 21763645

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 01:39PM PDT, ID: 21763996

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 02:28PM PDT, ID: 21764278

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 02:29PM PDT, ID: 21764284

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 02:51PM PDT, ID: 21764423

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 04:11PM PDT, ID: 21764887

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: rsaphier
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628