Results 1 to 7 of 7
  1. #1
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97

    Using * character (NOT wildcard) in a parameter query

    I am forced to use the "*" character in the criteria field of a parameter query.


    Criteria looks like : [Forms]![Patients].[Last name] & "*" & [Forms]![Patients].[First name]

    Just to retrieve values like "CLINTON*BILL"

    Can someone suggest right syntax plz ?? I have alrady tried unsuccessfully :

    [Forms]![Patients].[Last name] & '*' & [Forms]![Patients].[First name]
    [Forms]![Patients].[Last name] & "'*'" & [Forms]![Patients].[First name]
    [Forms]![Patients].[Last name] & '"*"' & [Forms]![Patients].[First name]

    And not, the syntax of the field cannot be changed because it relies on another database I cannot modify...
    PLZ HELP!!

  2. #2
    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,725
    Try using [*] ---square bracket around the asterisk

    eg

    [Forms]![Patients].[Last name] & "[*]" & [Forms]![Patients].[First name]

  3. #3
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    didn't work (caused an input box asking for [*] field value)...
    Other hints?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Don't understand what you are trying to do. Why is this necessary? What would be between CLINTON and BILL that needs to be wildcarded?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    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,725
    What is stored in the underlying table?
    Please show the query sql.

    I have attached a jpg showing a Form and a query based on a value in that form

    Name & "*" & id

    and it displays the result. I think we have to look closer at your query and parameter.
    Attached Thumbnails Attached Thumbnails AsteriskBetweenFileds.jpg  

  6. #6
    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,725
    June,
    I don't think he's trying to wildcard anything. I think he is trying to get output with an asterisk between first and last name,
    But I agree it isn't clear. I'd like to see the parameter query in SQL format.

    It's possible he has not told us everything.

  7. #7
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    orange, you understood correctly my questions.
    And sorry, [Forms]![Patients].[Last name] & "*" & [Forms]![Patients].[First name] was the right syntax, I just had wrong values in the field. Everything was ok. Sorry for boring you. Thank you for your prompt feedback!

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

Similar Threads

  1. Replies: 3
    Last Post: 10-31-2012, 12:50 PM
  2. Problem with a wildcard in a query criteria
    By desk4tbc in forum Programming
    Replies: 1
    Last Post: 08-10-2011, 06:02 PM
  3. replace a character with a wildcard
    By neeedhelp in forum Programming
    Replies: 2
    Last Post: 04-11-2011, 05:02 PM
  4. SQL wildcard character excluding
    By sandlucky in forum Access
    Replies: 2
    Last Post: 03-28-2011, 03:33 AM
  5. Parameter Query & Wildcard
    By Rick West in forum Queries
    Replies: 8
    Last Post: 12-29-2009, 10:54 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