Results 1 to 5 of 5
  1. #1
    kwelch is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2009
    Location
    Chicago, IL, USA
    Posts
    20

    Multiple entries for ApplyFilter?

    Could I use this macro to have a user insert multiple ID numbers to search a split form and return a list of results for each ID number entered?



    For example, the user would enter multiple IDs (medical record numbers) separated by a comma or a space and the data sheet of the split form would show only the entries for those specific IDs.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    no idea how the macro works (don't use them) but assuming it generates a sql criteria you would use the IN format i.e.

    myID IN (1,3,5,6,99)

  3. #3
    kwelch is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2009
    Location
    Chicago, IL, USA
    Posts
    20
    Quote Originally Posted by Ajax View Post
    no idea how the macro works (don't use them) but assuming it generates a sql criteria you would use the IN format i.e.

    myID IN (1,3,5,6,99)
    Since the user may input one or twenty record numbers (an unpredictable number), I don't see how I could preset this using the IN operator unless I could do something like this:

    myID IN([tbl_Patients]![MRNID])

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I don't think that would work- in vba you would set it up as

    me.filter="myID IN (" & me.[MRNID] & ")"
    me.filteron=true

    If tblPatients is another table, you can just create a query to join the two tables together

    I suspect what you are trying to do is either beyond the capabilities of macros or if doable, is certainly beyond my knowledge of macros.

  5. #5
    kwelch is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2009
    Location
    Chicago, IL, USA
    Posts
    20
    There is one table, and the primary key is MRNID, which is a medical record number that is unique. The table has other data as well.

    Basically I want to put into a text box or memo box a bunch of MRNIDs (the medical record numbers) and have the return be a data sheet of the patients. It can be a sub form; it can be a unique query table.

    I'll play with what you suggested though.

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

Similar Threads

  1. DoCmd.applyfilter for multiple
    By vicsaccess in forum Programming
    Replies: 4
    Last Post: 11-10-2015, 05:02 PM
  2. Help with Multiple entries
    By kevinscomp in forum Access
    Replies: 1
    Last Post: 09-15-2013, 12:26 AM
  3. Multiple Entries
    By alyon in forum Access
    Replies: 2
    Last Post: 05-15-2012, 07:45 AM
  4. Multiple entries
    By danelliott in forum Access
    Replies: 3
    Last Post: 11-08-2010, 08:08 AM
  5. Multiple entries
    By Ziggy-R in forum Access
    Replies: 11
    Last Post: 10-03-2010, 07:42 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