Results 1 to 4 of 4
  1. #1
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291

    Form Filter Causing slight problem

    I have a form that when I open it from another form with:

    Dim str1 As String
    str1 = Me.cmbArea


    DoCmd.OpenForm "DIForm", , , "[Area] ='" & str1 & "'"

    Problem:
    this works great but if I try opening it by itself it still has this same filter that was last used.

    What I want:
    I want the Form to open with no filter or a default filter if I just open the form.

    Things I have tried:
    1 - On Form_Close I tried
    Me.Filter = "[MN12] <> """""
    I set a break point and it sets the filter to this when I close the form but then when I open it back up it has the previous filter again.
    2 - Setting the Filter property field to
    [MN12] <> ""
    This works if I set it manually in the property table save close form then reopen. Once I open the form from my other form with the filter it goes back to the same problem.

    Any ideas would be appreciated, thanks.

  2. #2
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    ok sometimes it does it and some times it doesnt, I am confused. It seems that the actual records work correctly but the listbox I have using the following code uses an old filter.

    var2 = "SELECT InspectionsDI.ID, InspectionsDI.[Manhole Number (12)] FROM InspectionsDI WHERE InspectionsDI." & Me.Filter & " ORDER BY InspectionsDI.[Manhole Number (12)];"
    Me.lstDI.RowSource = var2
    Me.lstDI = Me!ID

  3. #3
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Well have you put any filter condition in the onLoad event of the form. This may cause the problem that whenever the form opens it opens it displays certain filtered records. check the record source of the form too. if it is a query check if you have put any conditions to it. If you can elaborate a little on these problem it will be more helpful. may if possible upload you db in access 2000 format.

  4. #4
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    It is really weird because I do something specific and it triggers it and then do the exact same thing and it doesnt happen so until I can get a better hold on the problem I am just gonna solve this thread and if I figure out the problem I will post a new one.

    Thanks for the help.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-25-2013, 10:56 AM
  2. vbCrLf is causing square box on last line
    By cowboy in forum Programming
    Replies: 1
    Last Post: 03-24-2010, 10:01 AM
  3. Filter by Form? Confused...
    By andmunn in forum Forms
    Replies: 0
    Last Post: 01-14-2010, 01:30 PM
  4. Checkbox filter on a form
    By aletrindade in forum Access
    Replies: 1
    Last Post: 12-02-2009, 06:22 AM
  5. Replies: 1
    Last Post: 07-30-2009, 12:54 PM

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