Update a Query in a Drop Down

bigbadbess24

Registered User.
Local time
Today, 12:19
Joined
Mar 9, 2006
Messages
83
I have a form with two drop downs (combo box) School and Players. The first drop down I select a school. After I select the school, I go to the next drop down (combo box) and select the players I want. When I go to the second combo box (players) its has a query that runs for me. It takes what ever school I select and only gives me the players from that school.
However, lets say I made a mistake and I selected the wrong school, I go back and select the right school, but when I go to players box, its shows me the players from the previous school.
My questions is, how do you run the query in the form again after you have select a school? When I go to a new record to put in the information, the same thing happens to, I get the players from the school I selected the first time.
 
do a after update event for the combo boxes, and in that use a me.comboboxname.requery
 
Thank you for your quick response, but that did not work. I put the expression for both combo boxes and information did not update.
 
Does each combo box have its own query?

and you changed the
comboboxname to the appropriate names correct?
 
The school combo box gets infomation from a table. The players combo box gets information from the query

And yes, when I put in the expression me.comboboxname.requery I put in the combobox name (combo17) I have in place of yours.
 
requery should work, but i must be missing something.

can u post a sample?
 
This should work

Here. instead of the after update. i put it in the dirty method. that way if its changed itll requery the other two!
 

Attachments

Thank you for you quick response and all your help
I saw what you did with the expressions. However it is doing the same thing. This time though, when I go back and select a different school, it makes it blank and I have to select it again. But when I select the select it again and go to the players list instead of having the old names, the players list is now empty
 
Im confused. What do u want it to do?
it requeries so that u can select the player from that specific team.

remove the me.combobox#.value="" from them to make them not blank, at the start.
The players list is not empty when i do it on my system

Try this
Code:
Private Sub Combo15_Change()
Me.Combo17.Requery
Me.Combo19.Requery
End Sub
 
First step, select a school, then select a player (the query gives me all the players in that school that I selected) and games won and position. When you click on next record do the same procedure. But when I go to next record I select a different school, if gives me the players from the last school and the same thing happens when I am on the first record and realize I put in the wrong school I change the school put it does not change the players.
 
Why are u clicking on next record?
is this to add information to another table?

I am missing something here cuz when i do click next record it allows me to add diff information to it and i can change previous records information also..
you are losing me

are you using the db that i posted up?
 
Yes I am adding this information to a table. I pulling the School from one table and putting it into another table and the same for players and position.

I looked at your db and even if I do not click on next record, Lets say I open the form for the first time and I put in one school (HT) and go to players, i get everyone i want to see from that school (HT), but on same first record I realize that I put in the wrong school, i go and change the school (toSD), go to players and its the same players I had from the first school selection (HT)
 
SD on the one you gave me contains no entries for players, and the update works, the only thing that doesnt change is the Name you had Selected in there from the previous school but selecting another name will overwrite that.

I do not know why it will not work for you.:(
 
Sorry I know SD has no players, all school will eventually have 20 players for 6 schools I was using them for a test
When I look at you DB and I open up the form its default to SD as the school. When I drop the school field it will not let me choose a school, its actually locked.
When I go to the tblMatch Results I can not even remove the line. Is there a reason why its locked on the one school
 
The copy i posted is working for me. i do not understand y u are having problems with it.
youve stumped me!
 
I figured it out. I had to put the expression in the school combo box. I put it under the Afterupdate and I put me.combobox(playersbox).requery
Basically means to update my players box after I change the school box.
Thanks for all your help!!
 

Users who are viewing this thread

Back
Top Bottom