Results 1 to 3 of 3
  1. #1
    tazquebec is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    6

    The ServerFilter of my subform is save when the form close.

    I want the informations shown in a subform to change when the value of a Drop Down Field. I use the property serverfilter of my subform.

    It works if there was no value beforehand in the property.

    Otherwise Access does not take in account the new criteria.

    I use Access 2003 with SQL Server 2005. The form use a view

    Thanks to the advance of your help and here is my code:

    Private Sub drpdwn_Section_Q_Change()
    Select Case drpdwn_Section_Q.Column(2)
    Case "S"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Vale ur_Avant_Étiquette").Caption = "NB Suite"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Nb_H rs_Avant_Étiquette").Caption = "Hrs Suite"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Vale ur_Apres_Étiquette").Caption = "NB Nouveau"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Nb_H rs_Apres_Étiquette").Caption = "Hrs Nouveau"
    Case "A"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Vale ur_Avant_Étiquette").Caption = "NB Année 1"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Nb_H rs_Avant_Étiquette").Caption = "Hrs Année 1"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Vale ur_Apres_Étiquette").Caption = "NB Année 2"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Nb_H rs_Apres_Étiquette").Caption = "Hrs Année 2"
    Case Else


    Me.frmMD_with_Desc_of_Activite.Form.Controls("Vale ur_Avant_Étiquette").Caption = "Hrs ?"
    Me.frmMD_with_Desc_of_Activite.Form.Controls("Vale ur_Apres_Étiquette").Caption = "Hrs ?"
    End Select
    Me.frmMD_with_Desc_of_Activite.Form.ServerFilter = "ref_Modele = " & drpdwn_Modeles.Value & " AND ref_Phase = " & drpdwn_Phase.Value & " AND ref_SA = " & drpdwn_Section_Q.Value
    Me.frmMD_with_Desc_of_Activite.Form.Requery
    Me.frmMD_with_Desc_of_Activite.Form.Repaint
    End Sub
    Last edited by tazquebec; 01-28-2010 at 10:22 AM. Reason: Add info

  2. #2
    tazquebec is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    6

    Smile On my way to work I had a flash

    I solve my problem by emptying the ServerFilter after the Requery. So when the form is close the ServerFilter propriety is save with an empty value. Yesterday I try that on the close event of the form but it did not work.

    Me.frmMD_with_Desc_of_Activite.Form.ServerFilter = "ref_Modele = " & drpdwn_Modeles.Value & " AND ref_Phase = " & drpdwn_Phase.Value & " AND ref_SA = " & drpdwn_Section_Q.Value
    Me.frmMD_with_Desc_of_Activite.Form.Requery
    Me.frmMD_with_Desc_of_Activite.Form.ServerFilter = ""
    Me.frmMD_with_Desc_of_Activite.Form.Repaint

    Thanks you for your time all and I hope my solution may help someone else.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for posting your solution.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Save and Go to another form - simple yes?
    By durstlaw in forum Forms
    Replies: 1
    Last Post: 12-15-2009, 12:46 AM
  2. Replies: 4
    Last Post: 09-10-2009, 03:09 AM
  3. close form
    By taylorosso in forum Forms
    Replies: 5
    Last Post: 08-25-2009, 12:18 PM
  4. Replies: 4
    Last Post: 04-01-2009, 11:48 AM
  5. Form requesting to save changes
    By stevo2820 in forum Forms
    Replies: 0
    Last Post: 07-30-2007, 07:41 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums