Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Darkladymelz is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    43
    This is the SQL:

    SELECT [Property Details].[Property Ref], [Property Details].[Property Address], [Property Details].County, [Property Details].[Post Code], [Property Details].[Property Type], [Property Details].Bedrooms, [Property Details].Floor, [Property Details].[Start Date], [Property Details].[End Date], [Property Details].Rent, [Property Details].[Guaranteed Rent], [Property Details].Supplier, [Property Details].[Landlord Ref], [Property Details].[Tenant Ref]
    FROM [Property Details]


    WHERE ((([Property Details].[Property Ref])=[Enter Property Ref:])) OR ((([Property Details].[Property Address]) Like ("*" & [Enter Address:] & "*"))) OR ((([Property Details].[Post Code]) Like ("*" & [Enter Postcode:] & "*"))) OR ((([Property Details].Bedrooms)=[Enter No of Bedrooms:]));


    When I enter N9 as a partial postcode (no other parameter values) it brings up a list of all postcodes with a N in it. If I want to enter a partial address (no other parameter value) I get no results at all. If I removed the code from Enter Postcode, the partial address works fine.

    I don't want to use the AND operator as I want the user to only need to enter one of the parameter values.

  2. #17
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Send a few test records, or send me a sample of your database in mdb (2003) format. I do NOT HAVE 2007.

    I went thru some old posts because this issue seemed familiar -seems this is a related post that was Solved
    https://www.accessforums.net/showthr...9261#post99261

  3. #18
    Darkladymelz is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    43
    Please find attached dummy database.

    It is the 'SearchProp' query.

    As you will see that the query will not work a partial address OR partial postcode, but if you delete the parameter value code from Postcode field, the address parameter value works perfectly.
    Attached Files Attached Files

  4. #19
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    The issue I believe is as follows:

    If you have criteria with a Like "*" & [parm], and you just hit Enter, you will get the equivalent of "*" (select all) for that parameter.

    In your test DB, SearchProp query
    Property ref (enter) <-- no value
    Address (n)<--------------------------Select June record
    POstCode (e)<-----------------------Selects where Postcode has E
    Bedrooms (enter) <--no value

    But if you just hit enter on address or PostCode (where partial match is the criteria) you'll get all records.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-25-2012, 08:07 AM
  2. Replies: 2
    Last Post: 10-20-2011, 08:31 AM
  3. partial display
    By tawright in forum Access
    Replies: 2
    Last Post: 07-20-2011, 09:38 AM
  4. Help: Comparison query to find non-matches
    By 14erclimber in forum Queries
    Replies: 6
    Last Post: 06-09-2010, 09:29 AM
  5. Replies: 1
    Last Post: 05-18-2010, 12:05 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