Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filter stops fields being updateable (Access 2003)

    Perhaps I'm being thick - but I had a simple little edit form that used a data source 'select * from Individual' and provided edit functionality to the fields such as name and address.

    I wanted to, on the same form, alloweentry of a lookup value. So I created an unbound label 'lookfor' and coded the following event on exit

    Private Sub Lookfor_Exit(Cancel As Integer)
    Me.Filter = "((IndividualId = " & Me.Lookfor & "))"
    Me.FilterOn = True
    End Sub

    It does exactly what I want, displaying the correct record for the individual with that Id. However, it also makes the form uneditable which is NOT what I want. (The only field that gets the focus is Lookfor.)

    Is there a way of allowing field updates within this filtered form - or should I be doing this in an entirely different way?
    Andrew

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter stops fields being updateable (Access 2003)

    Don't use the On Exit event of the text box for this, but use the After Update event instead. The On Exit event and moving to another record interfere with each other, effectively locking you into the Lookfor text box.

  3. #3
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter stops fields being updateable (Access 2003)

    Hansv

    Thankyou for both the reply and its speed and accuracy - another step forward <img src=/S/grin.gif border=0 alt=grin width=15 height=15> that seems to work very.
    I'm now happily editting - but when I go to save I get a message saying that the record is locked by another user (it isn't)
    I'm obviously now missing something else - any ideas?

    Andrew

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter stops fields being updateable (Access 2003)

    Does this only happen if you have used the Lookfor text box? Or does it also occur if you use the navigation buttons to go to a record?

  5. #5
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter stops fields being updateable (Access 2003)

    The form now has a filter permanently set and when it is invoked a second time, the result is a filter is on with no selected records, so I cannot check it by record selection. Before I coded Lookfor though, updates could be done [I used to use the Find function]
    Andrew

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter stops fields being updateable (Access 2003)

    I don't think the After Update code of the Lookfor text box causes the problem. I don't think we can offer further help without seeing the database. Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  7. #7
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter stops fields being updateable (Access 2003)

    OK - thanks
    Its running on an ODBC connection into SQL server so I'll make a local version of the table - if I'm dead unlucky, presumably it will fix the problem <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Rats - it did so I cannot demonstrate.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •