DLookup is a built-in MS-Access function to get the value of a particular field from the set of records or data from table, query, SQL, or Recordset.
Questions tagged [dlookup]
60 questions
2
votes
1 answer
Ensure Unique Records in Form (MS Access)
Using a Form in MS Access, I need to ensure only unique records are entered into the table.
It's unfortunately in a situation where I can't enforce unique records via the table's primary keys.
I have the following code in the BeforeUpdate for the…

Jay May
- 41
- 5
1
vote
1 answer
it is possible to use a dlookup on a public const in vba?
I have about 10 forms in my access and in all of them I need to put some basic information like, date and user, to do that I use the same code on all forms, I'm searching a form to set this information and just call
vba now
Private sub…

Tejota
- 21
- 4
1
vote
1 answer
Getting value from query into subform using Dlookup
I wanna put value Allowed from query S_makers_list using Dlookup into textbox into subform C_products in HCPP form. I'm trying to use current maker value in subform as criteria
=DLookUp("[Allowed]";"S_makers_list";"[maker]= " &…

Nir4s
- 15
- 6
1
vote
1 answer
DLookup with multiple criteria using Microsoft Access VBA
I am creating a form for employees to input their hourly output. It goes to a table called tracking, where there are 4 fields; Shift, Operator, Date_Field, and Machine. These fields are a unique index.
I want, if the person filling out the form adds…

zeppefin25
- 11
- 2
1
vote
1 answer
Using Varible in a Dlookup to rifle through a For Each Loop
Im calculating probabilities with numbers from diffrent tables. Every customer has a letter dedicated to a document number. These letters have a probability (0/ 0.3 or 0.7).Im new in Vba and dont really know why Im getting this error, or how i could…

YumiFerrari
- 13
- 2
1
vote
2 answers
DLookUp to return all occurrences instead of only the first one
I check if the date selected by the user matches the tblFestivity of the field Festivity_Date.
If these match I display a Message Box.
The field where the user inserts the date:
The table tblFestivity and the field Festivity_Date:
It works for the…

ObiGuinnessBartowski
- 13
- 3
1
vote
1 answer
Microsoft Access DLookup based on Entry Date
I am a newbie at Microsoft Access and have been trying to wrap my head around an issue.
I am using a form to search for an application number, based on a table (UpdatedFiles).
I am trying to get the form to display the latest entered status on a…

AccessNovice
- 13
- 3
1
vote
1 answer
how to combine a combobox with dlookup in Access
Objective: Form will provide the correct Unit of Measure and corresponding quantity per container using the item selected in a combo box. The units of measure are in a separate table.
Problem:
The dlookup is looking up user id instead of item. I…

Juan
- 21
- 2
1
vote
0 answers
I am having trouble with 'dlookup'
I am new at this so I apologize for any stupid questions.
Objective: When the user selects a location (Combo box) for an item previously selected, I want dlookup to give me a numeric value (QPC) saved in a other table. All the information is save an…

Juan
- 21
- 2
1
vote
1 answer
Why does DLookup not return the values updated during a transaction?
I am using transactions in my MS Access VBA code. I update one of my fields, the Incoming_Pieces field in my Inventory table. Then, before committing the transaction, I use DLookup on the updated field. The DLookup function will return the value…

Michael
- 3,093
- 7
- 39
- 83
1
vote
1 answer
conditonal with dlookup value
I have a subform with a field called "REMAINING PALLETS". In control source I have this look up formula:
=DLookUp("[CountofIdPEDIDOSPRODUCTOS]";"[SUMA PALETS]";"[PRODUCTOPEDIDO] = " & [Forms]![PEDIDOS]![PEDIDOSPRODUCTOS]![IdPEDIDOSPRODUCTOS])
I…

Ruy
- 27
- 4
1
vote
1 answer
Find and Replace Value in Table From DLookup Multiple Criteria VBA
I'm start to do programming in Access, and I really need help!!
My objective is to create a module that is run in "tbCustoProjeto" table and rewrite the field "Valor HH" values based on Dlookup. I found some solution (by azurous) who I think will…

Vinicius s.
- 13
- 2
1
vote
2 answers
Dlookup in side of a Loop Is it possible?
I am "creating" my first loop, I copied code and am trying to get it to work. I have the loop functioning but when I try to do a Dlookup in the middle of the loop it does not work.
I am sure there are some ways to make this code work better, Just…

Mr. Formula
- 11
- 1
1
vote
2 answers
Invalid use of Null when using DLookup in MS Access
I want to set the user login access in MS Access which means that if the user logs in as the admin it will show a different form.
I have tried to get the userlevel which is a string and will show things like "Admin" or "User" but it…

Jon Kim
- 97
- 1
- 11
1
vote
1 answer
Access VB IIf and dlookup
I'm trying to change the below code to incorporate several selnames,167 & 789 both would use the same Query as below. I have tried several suggestions but no luck - any ideas?
Code:
IIf([selName]=167,…

Shevy
- 11
- 2