Discussion in 'Access General' started by kevcar40, Aug 11, 2013.

  1. kevcar40

    kevcar40 Guest

    i am trying to return the supervisor number forma table dpending o what calues are selected from two combo boxes on a form

    i have wrote the code below which is run from and afterupdate event
    the first half of the code runs fine when i add the AND the code crashes

    Me.Text124.Value = DLookup("fldsupernumber", "TblAreas", "fldarea = [Cbo_team]" And "fldshift = [Cbo_shift]")

    can anyone please help me resolve this problem


    kevcar40, Aug 11, 2013
    1. Advertisements

  2. kevcar40

    Bob Quintal Guest

    You have some extra quotes in the criteria in the dLookup.
    Try "fldarea = [Cbo_team] And fldshift = [Cbo_shift]"
    Bob Quintal, Aug 11, 2013
    1. Advertisements

  3. kevcar40

    kevcar40 Guest

    thanks works a treat

    kevcar40, Aug 11, 2013
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.