|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ms Access
Hi again,
Ok, excuse me, I have some difficulty defining my problem because I work in French with a French version of Acccess. Hence, I do not know, the ususal English names. Here is what I have again. First, I have a departure form where the user select an option in an option in a "combo box" (?). Upon selecting an option, it opens a query and apply a filter to retain only certain lines. It does that well. Then, it opens a form where I have a list box which takes it content from the query above. Here is the instruction: SELECT [RequeteEleveParGrTuteur].[NoGrTuteur], [NomFamEleve] & ", " & [PrenomEleve] AS Expr1, [RequeteEleveParGrTuteur].[NoFiche] FROM RequeteEleveParGrTuteur ORDER BY [RequeteEleveParGrTuteur].[NoGrTuteur], [NomFamEleve] & ", " & [PrenomEleve]; The list box updates itself it I put a new entry in the request, but it is not what I need. What I need is that the list box retains only the filtered lines of the query and it does not. |
|
#2
|
|||
|
|||
|
You are not specifying the criteria in your SQL statement.
S- |
|
#3
|
|||
|
|||
|
List box update in MS Access
That is true.
I thought that an If statement in the vb code calling the query would suffice to do the job. Here is what calls the query and filters it: DoCmd.OpenQuery "RequeteEleveParGrTuteur", acViewNormal, acEdit If Me!Stockage1 = 1 Then DoCmd.ApplyFilter "RequeteEleveParGrTuteur", "[RequeteEleveParGrTuteur]![NoGrTuteur] = 101" ElseIf Me!Stockage1 = 2 Then ... The problem is that the list box which takes its entries from the query does not update to keep only the filtered entries as I want. What would you suggest? |
|
#4
|
|||
|
|||
|
What I would do is:
Have you main query reference a an invisible text box where you will populate the citieria based oin the selection of the combobox. This way it will only bring up what you need and you don't have to worry about the filter. in the criteria of you query enter the following (you will have to modify it to you names) [forms]![FormName]![TextBoxName] ALso you may want to pass you variable to the form you loading and have the query pick it up from that form instead of the one you are leaving (espically if you are closing that form). S- |
|
#5
|
|||
|
|||
|
Thank you It works
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Ms Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|