Question : Subform Dlookup with multiple criteria

I had this dlookup working then my dbase closed and did not save the changes.  

I couldn't remember how I had the last part of the following syntax, It returns #Error.

I'm trying to have a text box lookup the status of the most recent updated record (txtLastUpdated).
Code Snippet:
1:
=DLookUp("[StatusName]","lkpOrderStatusState","[OrderStatusStateID]=" & [Forms]![frmViewOrder]![SubFormOrderStatus]![cboOrderStatusState] & "And [LastUpdated]=" & [Forms]![frmViewOrder]![SubFormOrderStatus] & Last([txtLastUpdated]))

Answer : Subform Dlookup with multiple criteria

You refer to a Subform like this:

[Forms]![frmViewOrder]![SubFormOrderStatus]. FORM![cboOrderStatusState]

Also, I'm not sure what  "& Last([txtLastUpdated])" is supposed to do. AFAIK, there is no "Last" keyword or function in Access, although you may have a custom function named that
Random Solutions  
 
programming4us programming4us