DLookup Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm having trouble with this dlookup- I need to bring up a value for the
name of the category rather than its ID. The ID field is a foreign key in
another table and is a combo box , row source EMP Query. Every combination I
try results in an error or a parameter box being put up.
=dlookup("BandName", "Bands", "BandID=" & dlookup("BandID", "Members",
"MemberID=" & MemberID))
Any help would be greatly appreciated, thank you in advance-
 
Is MemberID a field in your report?
Is MemberID numeric or text?
Is BandID numeric or text?
What is the "parameter box" asking for?
 
Member ID is a field in my report, and it is a number. Band ID is a number,
too. The parameter box is asking for a value for the band ID- if I don't put
anything, then it just brings up the members of each band without the name on
the report. I'd like for it to look like this:
Band Name: The Next Best Thing
Izak
Skiid
Oatz
Ben
It's giving me- Band Name: 1
Izak, etc.
Any clue to what's going on? I can't figure out if the lookup field on
BandID is what's throwing me off.
 
Come back with some table structures and correct field names. Don't state
"Band ID" or "Member ID" when your field names are actually "BandID" and
"MemberID".
 
My tables are set up like this:
Bands: BandID, BandName, Location, Phone
Members: MemberID, BandID (combo box), FirstName, LastName, Phone, Yield
MemberID and BandID are Autonumber fields in their respective tables, and
Number fields in the foreign tables.
There is a one to many relationship between BandID and MemberID.
The EMP Query is based on BandID and BandName to populate the combo box.
On the report, The BandID field will only return its numeric value, instead
of the BandName value that it returns on forms or in the tables.
I'm just assuming that a dlookup is the solution here, since I can't get
anything else to work, but the one I posted first isn't working. Any thoughts
 
I found a solution that would work after stepping away from it for a while- I
just added the BandName field to the query and left theBandID field out of
the report. Works fine. I'm terribly sorry for all the row- You're good
people to be so patient. Thanks a lot and keep up the good work- Although I
am curious to know why you can't use the combo box or list box in the
report.... Aaron Regular
 
Back
Top