Share via

searching multiple fields in Access

Anonymous
2022-07-29T17:28:17+00:00

i have a table that contains a text field where I type in different notes. I have a form that I would like to use as a search form for that field. Can this be done? I design mode on the query it works fine but on the form it doesnt. i try using the "like" control and wild card, but to no avail. if anyone could give me advice i would greatly appreciate it. Thank you

Microsoft 365 and Office | Access | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2022-07-29T23:35:03+00:00

    You might like to take a look at FindWords.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    This little demo file illustrates the use of a FindWords function, along with two auxiliary functions, FindAllWords and FindAnyWord.  These functions will find any word or phrase in a column in a table.  It will only find true words or phrases, with no specious substring matches, which can occur with the use of the LIKE operator with wildcards.

    The demo uses T S Eliot's great poem The Wasteland, storing each line as a separate line in a table,  as its example.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,830 Reputation points Volunteer Moderator
    2022-07-29T21:06:18+00:00

    First, let me echo John's advice about a Notes table. Especially if you want to search in the field.

    Second, you are on the right track. You can create a filter. Use an unbound text box to enter the search text you want to fine, Then, in the After Update event use code like:

    Dim strFilter as String

    strFilter = "fieldname LIKE '*" & Me.controlname & "*'"

    DoCmd.RunCommand ac CmdApplyFilterSort

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-07-29T17:59:54+00:00

    This is quite possible, but without knowing the structure of your tables or any examples it's hard to suggest a specific solution. Could you post an example of what you've tried, and what you're trying to search?

    One concern is that you may be trying to store multiple notes jammed together in one big Long Text field. Such a field can be searched but it makes it much more difficult. A better design is to have a one-to-many relationship between your main table and a Notes table; each record of the latter would contain just one note (probably along with fields for the date/time the note was generated and who created the note).

    Was this answer helpful?

    0 comments No comments
  4. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2022-07-29T17:54:46+00:00

    Your subject line says "multiple fields", and the body talks about "a text field". That seems a contradiction. Can you explain?

    Was this answer helpful?

    0 comments No comments