dlookup with a contains criteria?

Can a Dlookup command search for part of a field rather than the whole thing. EX.
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.

Sponsored Links:

Related Topics

DLookUp formula
I am having some trouble with the DLookUp formula. It seems to be entered correctly; however I want to use either the CurrentUser() function or the WindowsNTUserID as my criteria (I.e. the third (3rd) part of the DLookUp formula.


Dlookup() for NULL
I have the below DLookup() but every time it returns null when I am sure there are records with these criteria. I have tested it without the [RecPosition] criteria and it works. What am I doing wrong here?

lngRecordID = DLookup("RecEmplID", "tblAuditTrail", "[RecEmplID] = " & lngEmplID & " AND [RecPosition


Dlookup() for NULL
I have the below DLookup() but every time it returns null when I am sure there are records with these criteria. I have tested it without the [RecPosition] criteria and it works.

lngRecordID = DLookup("RecEmplID", "tblAuditTrail", "[RecEmplID] = " & lngEmplID & " AND [RecPosition] = ''")


DLookup() with Date criteria
I'm having trouble with DLookup() using dates as part of a multiple criteria. I'm using the following;

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


Multiple criteria in DLookup
Are you able to have 2 criterias in a DLookup statement? Here's the vital info:
Expr: OnHandQty
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:
=DLookUp("OnHandQty","ICPartWarehouse",????)


Dlookup multiple criteria with yes/no field
I am trying to implement a user login by using a dlookup against a table called tblUser.

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


Numeric Criteria Expressions
To specify numeric criteria for an operation, you supply a numeric value as part of the string expression that forms the criteria argument.
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.


Using Dlookup to pull value from table with multiple criteria
I am trying to use the Dlookup function but am running into some issues when I try to use multiple criteria.

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


Dlookup and multiple criteria error
I have a problem with my dlookup statement. When I run it separately there are no errors and I get my results but when I combine them together with AND I get error runtime error ‘13’: Type mismatch.
All tables are text.


dlookup() with date
Maybe there's a small nuance I'm missing when using DLookUp with a date as the criteria.
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


dlookup syntax - multiple criteria
I'm struggling with the syntax for a dlookup with multiple criteria. (Also, you'll see that my Msgbox is wrong (as I can't recall how to handle a string variable).

Any assistance would be appreciated very much.

Dim iDirectorID As Integer
iDirectorID = Nz(DLookup("nameID", "tblFunctions", "episodeID = " & _ Me!cboSelectEpisode And "Function ='Director'"), 0)

If iDirectorID > 0 Then

Dim strDirector As String
strDirector = DLookup("FirstName" & " " & "LastName", "tblNames", "nameID" = iDirectorID)
MsgBox ("strDirector is already listed as the Director of this episode.")


DlookUp(Express, Domain, Criteria)
I want to use DlookUp(Express, Domain, Criteria) in my report. The problem is that, Express is a fixed [field name], but I want the field name to be changed depending on the CONTENT in a Text Box I define on the report. It mean the CONTENT is the name of the field. How can I do this


Query criteria select between two numbers
I have a query that I need to have it select between two numbers "8 or 10" and I cant figure out it would be done or even if it can in the criteria of the query field in question. What I wanted to do is at the end of the expression where it uses Dlookup I wanted to be able to instead use something that would let me choose either a 8 or 10. How can I do this?
Chad

Test: Sum([GoodFootage])/Sum([EmployeeTime]-([DTReason1Time]+[DTReason2Time]+[DTMaintReason1Time]))*DLookUp("TotalShiftHours","tblShiftHours


Acces 2007 Dlookup function and accentuted characters
I recently run into problems when found that Dlookup does not work corectly with strings that contain accentuated non latin characters. I.e. Dlookup returns Null when there was accentuated characters in criteria expression even if in table was corresponding record.

It worked in Access 2003 on another PC. The database format is Access 2003. But when I converted it to 2007 the problem was the same.

Does anybody faced with the same problem?


Is the ELookUp or DLookUp function can be retrieve all the value
Is the ELookUp or DLookUp function can be retrieve all the value which are Compatible with Criteria?
I think it is Possible by Modified the Criteria ,, but I did not know how so who is know ?
or
Is there a function that can retrieve all values which are Compatible with Criteria


dlookup versus SQL value search
to search for values using coding, we can use dlookup to find the values we need, like:
x=dlookup("fieldname","tablename","criteria=y")

so there we get the value for x.
how can I use SQL to get the value of x in a table?


Is there an 'Also' equivalent to 'And' for the DLookup function?
But forgot it all, and I've entirely retaught myself vba in the last three days while trying to programme a database), and I'm trying to programme a fairly complex changelog database.

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?


Dlookup error
I'm new to access and have little idea how to lookup a name from an employee ID.

Below is the formula I'm trying but it is erroring out and I don't know how to fix it.

Employee Name: DLookUp("txtFName","tblEmployee","Criteria =" & [tblEmployeeAttendance.fkEmployeeID])

Below is the error.

The express you entered as a query parameter produce this error: 'The object doesn't contain the Automation object 'Criteria.''


Adding criteria to RowSource
I have a listbox thats row source is set via dlookup. its copying SQL string from another table.

lstResults.RowSource = DLookup("[SQL_STRING]", "RebisView", "View_Name =" & Chr(34) & selview & Chr(34))

I need to add a creiteria to this row source. Problem is I cannot add it to the original SQL string as it is used in other parts of our application and can't be modified.

The criteria I would like to add is stored in a variable.

How can I add this criteria to the query after the query is set into the rowsource of the listbox?


Nest dlookup inside a dlookup
I am looking up the factory name for a field but the database stores the number - so I need to use a dlookup inside a dlookup. This is what I tried:

DLookup("Name", "WAVE3_ADD_REC", DLookup("[FACTORY]", "WAVE3_INVN_DL", "[Ref2] = '" & Me.cobLot1 &amp