• (2 Pages)
  • +
  • 1
  • 2

Creating a Search on an Access Form Using a "Search" Button Rate Topic: ****- 4 Votes

#16 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,181
  • Joined: 12-June 08

Posted 13 March 2019 - 07:04 AM

What's up with the exclamation point here?
04    Me!Text65 = Null

Was This Post Helpful? 0
  • +
  • -

#17 cbiaso   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-March 19

Posted 13 March 2019 - 07:11 AM

I do not know code very well. I just copied the code as it was given to me and then I adapted to my database. I have a couple hundreds of records and I need to be able to find them fast. The text I am looking for is alpha-numeric and it's field is listed as short text.
Was This Post Helpful? 0
  • +
  • -

#18 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,181
  • Joined: 12-June 08

Posted 13 March 2019 - 07:26 AM

Okay?

Then this line. Didn't it have quotes are a chunk of it?

03   Me.Recordset.FindFirst [Application #]= & 'Text65'

Was This Post Helpful? 0
  • +
  • -

#19 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6818
  • View blog
  • Posts: 28,229
  • Joined: 12-December 12

Posted 13 March 2019 - 07:31 AM

The exclamation point in Access is a shorthand reference to the controls collection, so Me!Text65 references a textbox (presumably) on the form. Please change its name.

You are creating a text expression which needs to be surround with double quotes. The ampersand (&) will then join (concatenate) text together. "Hello " & "Bob". But you also need to embed single quotes around the value of Text65.

You need a few more ampersands to construct the correct expression.
Was This Post Helpful? 0
  • +
  • -

#20 duffyt60   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 08-July 19

Posted 08 July 2019 - 06:07 AM

Thanks for your example below.

What if I want to search for any part of the data in the "Database Field" instead of having to search for all exact information in the filed?

For example, instead of search for "Duffy Clown", I just want to be able to search for "Duffy" or "Clown"?

Thank you in advance.

mod: giant quote removed

This post has been edited by modi123_1: 08 July 2019 - 06:50 AM

Was This Post Helpful? 0
  • +
  • -

#21 maceysoftware   User is offline

  • Member Title
  • member icon

Reputation: 381
  • View blog
  • Posts: 1,621
  • Joined: 07-September 13

Posted 08 July 2019 - 06:26 AM

There is no need to quote the whole post, you can use the post button further down the screen.

Also for reference, Duffy has logged the question here:

Access 2016 Search Button On Form
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2