• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 486
  • Last Modified:

DLookup to show multiple records on continuous form

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
Saichand
Asked:
Saichand
  • 5
  • 3
  • 2
  • +1
1 Solution
 
derekkrommCommented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Try this expression:

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

mx
0
 
SaichandAuthor Commented:
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!

 
SaichandAuthor Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Also ... how do you get your form to populate with data ?

mx
0
 
SaichandAuthor Commented:
i didnt get your question DatabaseMX
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
When the form opens, no records are showing.  What are the steps to get records showing ?

mx
0
 
SaichandAuthor Commented:
select the state and jurisdiction in the drop down..
0
 
BitsqueezerCommented:
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
 
BitsqueezerCommented:
...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
 
SaichandAuthor Commented:
Not a complete answer i was looking for... but suggestion did help
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now