Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup Help 1

Status
Not open for further replies.

Jazztpt

Vendor
Feb 16, 2005
50
Using Access 2002 I have this placed in the control source property and it works.

=Dlookup("[OWThres]","COIndex","[Age]= " & forms![BIData]!Age)

However, I need to sort using an additional field [Sex] but everything I have tried returns an error, could someone give me the correct syntax to ref 2 fields on my form.

Thanks
Jazztpt
 
Something like this ?
=Dlookup("OWThres", "COIndex", "Age=" & Forms!BIData!Age & " AND Sex='" & Forms!BIData!Sex & "'")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the reply - I am at work at the moment so can't try it. It's similar to what I had but It wouldn't work for me so I obviousley have something wrong somewhere.
I have an additional problem which you may be able to help with. The table I am retriveing data from has the age ranges in increments of half years, 7 , 7.5 , 8 , 8.5.
The ages on my form may be between these figures, i.e. 7.2 or 7.7 , I need to return the values based on age 7 & 7.5 respectively.
Cheers
Jazztpt
 
Something like this ?
Int(2 * Forms!BIData!Age) / 2

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for your reply, I'm a beginner , where would I put that.
Thanks
Jazztpt
 
Assuming you already have a query built to return the data you need, you can just put it in the "criteria" row of the age field in the Access query design view.

Collen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top