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
SaichandAsked:
Who is Participating?
 
BitsqueezerConnect With a Mentor Commented:
...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
 
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 Access MVP)Database ArchitectCommented:
Try this expression:

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

mx
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
SaichandAuthor Commented:
Do you know or have any custom function?
0
 
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 Access MVP)Database ArchitectCommented:
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 Access MVP)Database ArchitectCommented:
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
 
SaichandAuthor Commented:
Not a complete answer i was looking for... but suggestion did help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.