Results 1 to 5 of 5
  1. #1
    jopi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2014
    Posts
    20

    Open form and display filtered dataset


    Click image for larger version. 

Name:	Search Image.jpg 
Views:	15 
Size:	73.9 KB 
ID:	17836
    Form "Clientes"
    Attached Files Attached Files

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Not sure how you accomplished it but, you are trying to use data type Text (second example on the left) where Access is expecting data type Number.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    To be exact, ID_Animal is an AutoNumber, and to open a Form to the Record whose ID matches, you're using the code

    Code:
    DoCmd.OpenForm "Animais", acNormal, , "ID_Animal like '*" + CxCombAnimal.Value + "*'", , acWindowNormal


    The problem is, the Like operator can only be used against Text; it cannot be used with a Numeric field. A Numeric match has to be exact. Replace the above with

    Code:
    DoCmd.OpenForm "Animais", acNormal, , "ID_Animal = " & Me.CxCombAnimal.Value, , acWindowNormal


    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    jopi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2014
    Posts
    20
    Great help! Thanks a lot!

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 3
    Last Post: 08-29-2013, 02:14 PM
  2. Replies: 1
    Last Post: 04-28-2013, 09:43 PM
  3. How to run macro on filtered dataset
    By FredLanger in forum Forms
    Replies: 7
    Last Post: 04-02-2012, 12:27 PM
  4. Replies: 7
    Last Post: 01-12-2011, 08:59 AM
  5. Open form to filtered records
    By ducecoop in forum Access
    Replies: 3
    Last Post: 10-22-2010, 10:53 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
  •  
Other Forums: Microsoft Office Forums