E
Erica
Hello,
I am trying to create a database for a book collection. I have a form
based on the table containing the book information that I would like
to use for circulation, so the librarian will need to be able to
search by ResourceID, author, and title. I successfully created a
text box and search button to search the ResourceID, which is an
AutoNumber field, with the following code ( I am completely unfamiliar
with Visual Basic, and am just working with code I copied from the
web):
Private Sub Command64_Click()
If IsNull(Text60) = False Then
Me.Recordset.FindFirst "ResourceID=" & Text60
Me!Text60 = Null
If Me.Recordset.NoMatch Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
Me!Text60 = Null
End If
End If
End Sub
I tried to create the same code for the Title field, but it doesn't
work. I substituted the correct button name (Command70) and text box
name (Text68), as well as the field name ("Title="), but I get a
syntax error saying that I'm missing an operator. The Title field is
a text field. When I tried the same code for a Yes/No field, it
worked fine. Does this code not work with text fields?
Ideally I would like the librarian to be able to enter just a portion
of the title rather than the exact value, so rather than = I want to
use LIKE or something of the sort, but if I can't even get the = to
work I don't know how I'd go about that.
Any help would be sincerely appreciated!
I am trying to create a database for a book collection. I have a form
based on the table containing the book information that I would like
to use for circulation, so the librarian will need to be able to
search by ResourceID, author, and title. I successfully created a
text box and search button to search the ResourceID, which is an
AutoNumber field, with the following code ( I am completely unfamiliar
with Visual Basic, and am just working with code I copied from the
web):
Private Sub Command64_Click()
If IsNull(Text60) = False Then
Me.Recordset.FindFirst "ResourceID=" & Text60
Me!Text60 = Null
If Me.Recordset.NoMatch Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
Me!Text60 = Null
End If
End If
End Sub
I tried to create the same code for the Title field, but it doesn't
work. I substituted the correct button name (Command70) and text box
name (Text68), as well as the field name ("Title="), but I get a
syntax error saying that I'm missing an operator. The Title field is
a text field. When I tried the same code for a Yes/No field, it
worked fine. Does this code not work with text fields?
Ideally I would like the librarian to be able to enter just a portion
of the title rather than the exact value, so rather than = I want to
use LIKE or something of the sort, but if I can't even get the = to
work I don't know how I'd go about that.
Any help would be sincerely appreciated!