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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering list boxes showing result 1

Status
Not open for further replies.

Greg553

MIS
Jul 6, 2009
60
US
First let me say that I have learned more from this site than most of the books i have read. The books only show all the basics.
Thanks to everyone who has helped.

I am trying to filter a list box, what I want to do is choose a players name in the first list box and have the second list box show the lifts and max weight he has lifted for each lift.
This is my set up

Tbl_PlayerInformation
PLayer_ID (PK)
Fname
Lname

Tbl_CoreLifts
Lift_ID(PK)
LiftType

Tbl_WeightResults
Weight_ID(PK)
Player_ID
Lift_ID
LiftDate
WeightLIfted

My two list boxes are

ListBoxNames ( sourcr is PlayerInformation table)
Bound by Player_ID to Weight results table

ListBoxLifts ( source Core lifts table) I store the lift_ID in weight results table

I would like this list box to show only the lifts and weight for the player chosen in the list BoxNames.
Should I be using a Query to get the lifts and weights for the players instead of the core lifts table. The core lifts table is related to player information table and shows what lifts each kid has done in the table view
 
i am getting an error and can not seem to find where i'm wrong

this is the select code

SELECT [Tbl_corelifts].[LIft_ID], [tbl_corelifts].[lifttype] FROM [tbl_corelifts] ORDER BY [tbl_corelifts].[lifttype] WHERE ((( [tbl_corelifts].[player_ID]) = [forms].[weightentry].[listboxcorelifts])) ORDER BY [tbl_corelifts].[lifttype]

says there is a syntax error
 
[forms]![weightentry]![listboxcorelifts]

. ( a property or method)
! ( an item of a collection)
 
Code:
SELECT LIft_ID, lifttype FROM tbl_corelifts WHERE player_ID = [Forms]![weightentry]![listboxcorelifts] ORDER BY lifttype

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks guys, for some reason I read some where that it did not matter if it was a . or !...
must have interpreted it wrong........

all solved
Greg
 
hey guys, I did have it for a minute I thought.
Now I'm getting the parameter box opening up when i open the form.
It also dos not update second list box when i change a value in the first list box.
this is the SQL i have in the row sourcr of the second listbox

SELECT tbl_weightresults.Player_ID, tbl_weightresults.LIft_ID, tbl_CoreLIfts.LiftType, Max(tbl_weightresults.WeightLifted) AS MaxOfWeightLifted
FROM tbl_CoreLIfts INNER JOIN tbl_weightresults ON tbl_CoreLIfts.Lift_ID = tbl_weightresults.LIft_ID
GROUP BY tbl_weightresults.Player_ID, tbl_weightresults.LIft_ID, tbl_CoreLIfts.LiftType
HAVING (((tbl_weightresults.Player_ID)=[forms]![weightentry]![cbonames]))
ORDER BY tbl_weightresults.Player_ID;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top