ListBox shows all records

Blackwidow

Registered User.
Local time
Today, 06:05
Joined
Apr 30, 2003
Messages
149
I have a form with a subform which has a listbox on it which lists all the letters sent home to a student. However despite the subform being linked by admission Number the list box is showing all records and not just the ones associated with the student.

I know this is going to be really obvious but please can someone tell me what is wrong?
 
Not 100% sure this is correct but I think the subform should be driven from it's own query. Within the query you need to set the criteria for Admission Number to the Admission Number displayed on the Form.

eg

[Forms]![YOURFORMNAME]![AdmissionNo]

Please note. I think this will only work on single page view and not continuous.
 
tried to put that in the query but it didnt work..

I've attached a copy of it just incase anyone can shed any light on it...
 

Attachments

I can't open the db due to the old version of access I use, but another way is to remove it from your form and insert it again. It should prompt the wizard. Within this there is an option to link a field from the master form to the subform.

You could try this.
 
I did it origionally from the wizard.... and its not working.. I just assumed it had worked after all if you put a subform in etc it seems to work... just I have never had to use a listbox before
 
The problem was that your lookup field has the Admission Number as the Bound column, but there was no Admission Number on the form, so the filter wouldn't work. I've fixed this by adding an Admission Number field to the form, then just setting the property Visible to No.

I've attached the ammended VB. Just remember you didn't ask anything about the rest of the form ;)
 

Attachments

remember i didnt ask anything about the rest of the form???!!

Arrrgghhhh Panic-stricken now... whats wrong?? you have to tell me now


waiting on tender hooks noose already round my neck!
 
Nothing is "wrong". From what I could see, when you select the Student, the other two subforms don't seem to change (they may indeed not need to change but I would presume they should also filter on Student). I take it thats tomorrow's task?
 
I downloaded that copy you attached and it seems to be totally botched up...
going to attach another copy... i think my origional was messed up but the list still isnt just showing the letters sent to a particular student and now when I click on something from the list it doesnt open up a record like it did before :( I think I have got myself into quite a mess here :( i've attached another copy.

Please can someone have another look
 

Attachments

"I take it thats tomorrow's task?"

- it was all working yesterday :( now i feel like crying
 
sorry no i meant the copy i put on origionally! not you sorry hon i didnt mean you at all... i'd stripped the database wrong and it wasnt working properly...

any help given is very very much appreciated!
 
OK I've not done a complete fix for you, but this should be enough for you (hey, you pay peanuts, you get monkeys...). Your problem was that you need the Admissions ID as they key field throughout that form, but you don't have it included in your forms. You also had a form, which was linked to the right table, but then you put all the fields in an unbound subform. I took this off, add the fields to the form, then saved it and hey presto, of course now it shows the relevant information for the pupil you have selected. You should be able to use that example to fix the other form. Again, you can easily hide the Admission Number by setting that field's property Visible to none; no one needs to see this number, but it needs including on every subform here as its the way you are identifying your students. Good luck.
 

Attachments

See attachement... I have replaced your list box by a subform.


Le
 

Attachments

:) :) :) : :) :) :) :)

Thank you very very much!!!

i'd kiss you but you live in yorkshire!

thanks for taking the time to look at it again for me
 
Blackwidow said:
i'd kiss you but you live in yorkshire!

LOL I'll take it that means its too far away, not that we Yorkshire people don't like being kissed...
 

Users who are viewing this thread

Back
Top Bottom