dlookup

  • Thread starter Thread starter kevcar40
  • Start date Start date
K

kevcar40

hi
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

thanks

kevin
 
hi
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

thanks

kevin

You have some extra quotes in the criteria in the dLookup.
Try "fldarea = [Cbo_team] And fldshift = [Cbo_shift]"
 
hi 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 thanks kevin

thanks works a treat

kevin
 

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

DLookUp error 2
DLookUp Help 5
DlookUp Problems 1
Run-timer error '2001' 1
Problems With DLookup code 4
Type Mismatch in dLookup 9
DLookup 6
Problem with VB/Dlookup filling fields 1

Back
Top