Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DLookup to show multiple records on continuous form

Posted on 2011-03-07
11
Medium Priority
?
484 Views
Last Modified: 2012-05-11
Hi,

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..


test1.mdb
0
Comment
Question by:Saichand
[X]
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
11 Comments
 
LVL 15

Expert Comment

by:derekkromm
ID: 35059213
DLookup can only return a single value.

From Microsoft's website (http://support.microsoft.com/kb/208786):
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.
0
 
LVL 75
ID: 35059225
Try this expression:

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

mx
0
 

Author Comment

by:Saichand
ID: 35059228
Do you know or have any custom function?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23375131.html

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

mx
0
 

Author Comment

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

mx
0
 

Author Comment

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

Expert Comment

by:Bitsqueezer
ID: 35088040
Hi,

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.
test1.zip
0
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 1000 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.

Cheers,

Christian
0
 

Author Closing Comment

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

618 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