dlookup with a contains criteria?
Dlookup is RecipientX = DLookup("RecipientID", "MasterFeedData", "[Logins]=" & Me!JID)
Logins field contains CITIGRTS,CITIGRPS,GTORTTRO
jID input contains CITIGRPS
Currently dlookup looks for an exact match between Logins and JID. I want to change the Dlookup to look for partial matches in the Logins field if possible.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
If IsNull(DLookup("ExchRate", "TBL_DDPExchRates", "CurID = " & Me.Combo4 & " AND ExchDate = #" & Me.ShipOBDate & "#")) And Me.Combo4 2 Then
It seems that if ShipOBDate is any date between the first and tenth of the month the DLookup fails to locate the appropriate record. I can't understand why as ShipOBDate and ExchDate areboth formatted as Short Date and ExchDate is being populated via an OpenArgs which is derived form the field ShipOBDate
Is the fact the the date is getting converted from a date to string and back to a date some how upsetting things
Suppose that you are performing the DLookup function on an Employees table to find the last name of a particular employee, and you want to use a value from the EmployeeID field in the function's criteria argument.
All tables are text.
my DMax returns correctly
I do not get an error with my DLookup
BUt the DlookUp retuns the wrong value.
vMaxDate = DMax("[Version_Date]", "tblVersionInfo")
vlblVersion_Info = DLookup("[Version_ID]", "tblVersionInfo", "'[Version_date] = " & vMaxDate & "'")
Me.lblVersion_Info.Caption = vlblVersion_Info
Anyway, when trying to create an issues registry I discovered a fairly major flaw in my programming in that a DLookup function was returning stuff for any record that fulfilled any one of the criteria, rather than just the one that fulfilled all of them.
Is there a way of doing this with the DLookup command, or do Ineed to try something else entirely?
I am not sure if the syntax is right it gives me an "#Error" in the Account Description field.
textbox = #Name? when CustID is null, using Nz and setting the textbox to an empty string if there was no Customer id
=IIF(IsNull(CustID).) and =IIF(Not IsNull(CustID). And still the textbox always turns up as #Name?
I tried to evaluate the code in vba and even when CustID is null, it still attempts to evaluate the DLookup instead of just giving me the appropriate value.
I realize that I can set the value of this textbox on Current event, or through VBA using simple If statement, but is there a solution where I can just set the controlsource in design to evaluate it?