1 Replies - 145 Views - Last Post: 20 November 2017 - 12:37 PM Rate Topic: -----

#1 freddyparc  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-November 17

how to create search in ms access

Posted 20 November 2017 - 10:02 AM

I have tried to create a search for field,I used text box and a button on my form
the code below is what I used
  <  Private Sub Command81_Click()

       If IsNull(Text78) = False Then

          Me.Recordset.FindFirst "[Last Name]=" & Text78

          Me!Text78 = Null

          If Me.Recordset.NoMatch Then

             MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"

                Me!Text01 = Null

          End If

       End If
End Sub  >

:code:
The error I got :The Microsoft Database engine does not recognize "Database field" as a valid field name or expression.

This post has been edited by modi123_1: 20 November 2017 - 10:06 AM
Reason for edit:: In the future, please use the [code] tag button in the editor.


Is This A Good Question/Topic? 0
  • +

Replies To: how to create search in ms access

#2 andrewsw  Icon User is online

  • blow up my boots
  • member icon

Reputation: 6442
  • View blog
  • Posts: 26,058
  • Joined: 12-December 12

Re: how to create search in ms access

Posted 20 November 2017 - 12:37 PM

"[Last Name]=" & Text78 If Text78 is a textual value then it needs to be surrounded with single quotes.

You should rename all your controls to something more useful that Text78, Command81.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1