ms access 2013 - Dlookup string failing -


for reason can't dlookup function correctly keep getting errors. error data type mismatch.

  option compare database   private sub command131_click()   docmd.setwarnings false   if (nz(dlookup("lettersent1bool", "dbo_t_volunteers", _  "volunteerid = '" & me![volunteerid] & "'"))) > 0   msgbox "error !     volunteer has received letter ,"  else   docmd.openquery "produceletterssixtotwelve", , acreadonly  if dcount("*", "dbo_t_sixtotwelveweeks") > 0   msgbox "success !    please open mail merge template"   else  msgbox "error !     no records found"  end if  end if  end sub 

figured out, need remove quotes around & me![volunteerid]

option compare database private sub command131_click() docmd.setwarnings false if (nz(dlookup("lettersent1bool", "dbo_t_volunteers", _ "volunteerid = " & me![volunteerid]))) > 0  msgbox "error !     volunteer has received letter ," else  docmd.openquery "produceletterssixtotwelve", , acreadonly if dcount("*", "dbo_t_sixtotwelveweeks") > 0   msgbox "success !    please open mail merge template"   else  msgbox "error !     no records found"   end if  end if  end sub 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -