Link to home
Start Free TrialLog in
Avatar of Saichand
Saichand

asked on

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
Avatar of derekkromm
derekkromm
Flag of United States of America image

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.
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Try this expression:

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

mx
Avatar of Saichand
Saichand

ASKER

Do you know or have any custom function?
i was reading through the below link and the code wasnt working.

https://www.experts-exchange.com/questions/23375131/DLookup-with-multiple-records.html

Also ... how do you get your form to populate with data ?

mx
i didnt get your question DatabaseMX
When the form opens, no records are showing.  What are the steps to get records showing ?

mx
select the state and jurisdiction in the drop down..
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
ASKER CERTIFIED SOLUTION
Avatar of Bitsqueezer
Bitsqueezer
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not a complete answer i was looking for... but suggestion did help