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.
lngRecordID = DLookup("RecEmplID", "tblAuditTrail", "[RecEmplID] = " & lngEmplID & " AND [RecPosition
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
table name: ICPartWarehouse
criteria: FKICPart = me.FKICPart and WarehouseNumber = 3
both FKICPart & WarehouseNumber are fields within the table
Here's what I have so far:
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.
The concept is that if the password entered into the text box matches the password in the table WHERE the username matches the username in the table and the active yes/no field is true then it will let the user in, if not it will throw an error and ask the user to enter again.
My problem is that I am getting a type mismatch within my dlookup. This must be due to the yes/no field I have added into the criteria as it was working before I put this in.
Here's what I have:
If Me.txtPassword.Value = DLookup("[password]", "[tblUsers]", "[active] = -1 " And "[username]= " & "'" & Me.txtUsername.Value & "'") Then . etc
I have a table that has the a price for a given range of thicknesses. I want the Dlookup to pull the price from the correct range. The ranges are defined by two fields, LowThickness and HighThickness.
For example, let's say I have a different price if the thickness is 0 to 1, 1 - 2, and anything over 2. I want the user to be able to input a number, say 1.556, and have it lookup the correct cost from the 1-2 range.
Here is what I have:
MaterialCost = DLookup ( "[Cost]","[tbl_MaterialCost", "[LowThickness]< " & Thickness And "[HighThickness] >= " & Thickness & "")
Edit: If there is a better or simpler way to accomplish this, including redesiging the tables involved, I'm all ears
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