If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#Error as DLOOKUP result
I'm using the following:
=DLookUp("[NAME]","006_Employee_tbl","[EMP#]=" & DLookUp("[EMPNO]","005_DMLog_tbl","[DM#]=[Forms]![002PaybackEntry_frm]![txtFergusonChargeback#]")) It works fine when txtFergusonChargeback# is in 005_DMLog_tbl. But when it isn't it returns "#Error". I need it to stay blank in that case. Any suggestions? Thanks!! -- GD |
#2
|
|||
|
|||
#Error as DLOOKUP result
The problem is that the inner DLookup is returning Null, and you can't use
Null with =. Try: =DLookUp("[NAME]","006_Employee_tbl","[EMP#]=" & Nz(DLookUp("[EMPNO]","005_DMLog_tbl","[DM#]=[Forms]![002PaybackEntry_frm]![txtFergusonChargeback#]"), 0)) or even =Nz(DLookUp("[NAME]","006_Employee_tbl","[EMP#]=" & Nz(DLookUp("[EMPNO]","005_DMLog_tbl","[DM#]=[Forms]![002PaybackEntry_frm]![txtFergusonChargeback#]"), 0)), "Not found") -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message ... I'm using the following: =DLookUp("[NAME]","006_Employee_tbl","[EMP#]=" & DLookUp("[EMPNO]","005_DMLog_tbl","[DM#]=[Forms]![002PaybackEntry_frm]![txtFergusonChargeback#]")) It works fine when txtFergusonChargeback# is in 005_DMLog_tbl. But when it isn't it returns "#Error". I need it to stay blank in that case. Any suggestions? Thanks!! -- GD |
#3
|
|||
|
|||
#Error as DLOOKUP result
Genius! Thanks, Doug!
-- GD "Douglas J. Steele" wrote: The problem is that the inner DLookup is returning Null, and you can't use Null with =. Try: =DLookUp("[NAME]","006_Employee_tbl","[EMP#]=" & Nz(DLookUp("[EMPNO]","005_DMLog_tbl","[DM#]=[Forms]![002PaybackEntry_frm]![txtFergusonChargeback#]"), 0)) or even =Nz(DLookUp("[NAME]","006_Employee_tbl","[EMP#]=" & Nz(DLookUp("[EMPNO]","005_DMLog_tbl","[DM#]=[Forms]![002PaybackEntry_frm]![txtFergusonChargeback#]"), 0)), "Not found") -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message ... I'm using the following: =DLookUp("[NAME]","006_Employee_tbl","[EMP#]=" & DLookUp("[EMPNO]","005_DMLog_tbl","[DM#]=[Forms]![002PaybackEntry_frm]![txtFergusonChargeback#]")) It works fine when txtFergusonChargeback# is in 005_DMLog_tbl. But when it isn't it returns "#Error". I need it to stay blank in that case. Any suggestions? Thanks!! -- GD |
Thread Tools | |
Display Modes | |
|
|