Results 1 to 3 of 3

Thread: Form in Datasheet View to filter table data

  1. #1
    Kirsti is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    164

    Form in Datasheet View to filter table data

    Hi,

    I have a new problem!

    I have one table in my DB. I have a group of users who require a 'spreadsheet-like' view of the data, and will also be inputting data. So, I have created a form (datasheet view). However, the users only need to see a subset of the data in the table. The criteria is really simple, i.e. Field_1 = False And Field_2 = False And Field_3 = "xxx".

    I've tried putting this criteria into the 'Filter' field in the Data tab of the properties box in the form, but the filter isn't applied. I've tried writing a private sub in vba (Me.Filter = (Field_1 = False And Field_2 = False And Field_3 = "xxx") Me.FilterOn = True, and still the filter isn't being applied.

    Can someone please point out where I am going wrong?

    I can easily create a maketable query and link the form to the new table, but that is replicating data in the database and something I am trying to avoid - it seems as though it should be simple to do it within the form.

    Thanks,
    Kirsti

  2. #2
    June7's Avatar
    June7 is online now Moderator
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    24,407
    Put the filter string within quotes in either the property or code.

    "Field_1 = False And Field_2 = False And Field_3 = 'xxx'"
    To provide db: Make copy, remove confidential data, run compact & repair, zip if large - 2mb allowed, attach to post. Attachment Manager is below the Advanced post editor window.
    If suggestion in this post resolves your issue, please use the Thread Tools and mark the thread as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  3. #3
    Kirsti is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    164
    Thanks June - I actually ended up using the query builder within the Record Source in the Form properties, and got it working that way. Looks like your solution would have been quicker though!

    Thanks again,
    Kirsti

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

Similar Threads

  1. Datasheet view of Split Form in a Tab??
    By tylerg11 in forum Forms
    Replies: 3
    Last Post: 12-19-2011, 02:37 PM
  2. Replies: 1
    Last Post: 12-17-2011, 11:52 PM
  3. Replies: 3
    Last Post: 12-06-2011, 09:32 AM
  4. Form opens table in datasheet view
    By franklbl in forum Forms
    Replies: 9
    Last Post: 03-23-2011, 08:43 PM
  5. Form - Datasheet View
    By kalove in forum Forms
    Replies: 0
    Last Post: 06-20-2007, 10:29 AM

Posting Permissions

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