Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 2nd, 2003, 08:21 AM
yrondeau yrondeau is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Montréal
Posts: 8 yrondeau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old December 2nd, 2003, 11:54 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
You are not specifying the criteria in your SQL statement.
S-

Reply With Quote
  #3  
Old December 2nd, 2003, 12:57 PM
yrondeau yrondeau is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Montréal
Posts: 8 yrondeau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #4  
Old December 2nd, 2003, 01:08 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
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-

Reply With Quote
  #5  
Old January 12th, 2004, 02:19 PM
yrondeau yrondeau is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Montréal
Posts: 8 yrondeau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you It works

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Ms Access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway