DLookup to show multiple records on continuous form

Posted on 2011-03-07
Last Modified: 2012-05-11

i am using the dlookup function in a text box and its giving me a one value. Can someone help me to modify the function which would give the result as multiple values.

attached is a copy of the database..

Question by:Saichand
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
LVL 15

Expert Comment

ID: 35059213
DLookup can only return a single value.

From Microsoft's website (
The DLookup() function returns one value from a single field even if more than one record satisfies the criteria. If no record satisfies the criteria, or if the domain contains no records, DLookup() returns a Null.
LVL 75
ID: 35059225
Try this expression:

=DLookUp("Account","Query1","[State]=" & Chr(34) & [cmbmstate] & " and [juris]= " & Chr(34) & [cmbmjuris] & Chr(34))


Author Comment

ID: 35059228
Do you know or have any custom function?
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  


Author Comment

ID: 35059235
i was reading through the below link and the code wasnt working.

LVL 75
ID: 35059236
Also ... how do you get your form to populate with data ?


Author Comment

ID: 35059268
i didnt get your question DatabaseMX
LVL 75
ID: 35059467
When the form opens, no records are showing.  What are the steps to get records showing ?


Author Comment

ID: 35059733
select the state and jurisdiction in the drop down..
LVL 24

Expert Comment

ID: 35088040

you can of course use a recordset and assemble the wanted account numbers to insert it into a textbox. See the attached file for that.
LVL 24

Accepted Solution

Bitsqueezer earned 500 total points
ID: 35088074
...should not enter a "brief description" with enter key...:-)

I wanted to add that you should better use a subform and then show the wanted records instead. As you already have a checkbox field in the table you can add this so the user can check or uncheck any row or you can use your UPDATE command to check/uncheck them. The query needed for the subform would be your Query1. No problems with DLookup or VBA code to assemble a string with a recordset.



Author Closing Comment

ID: 35117912
Not a complete answer i was looking for... but suggestion did help

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using a combo box ListItemsEditForm property 5 41
Runtime Error -2147467259 (80004005) 7 47
Error Sorting a calculated table field control 2 22
Access query error 3 25
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question