CoreyBuchan
New member
- Local time
- Today, 12:37
- Joined
- Jun 21, 2012
- Messages
- 3
Firstly I am using Microsoft Access 2007
I am currently trying to build a database that can search through specific lessons learnt for a company. I have started by building a table, which includes Title, Project, Date, Summary, Category, Attachments and Key Words. Next I created a split form called Lessons Learnt List, which includes the table and at the top has a button called new lesson. When this button is pushed it is linked to another form which pops up and is called Lessons Learnt Details which allows new lessons learnt to be added to the table. The save and exit button work fine. A new form was created called Lessons Learnt Search, this is where I am having the problem. I have created a text box and linked it the table and then created a button. The button has been given the code:
Private Sub Search_Click()
If IsNull(Title) = False Then
Me.Recordset.FindFirst '[Title]=' & Title
Me!Title = Null
If Me.Recordset.NoMatch Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
Me!Title = Null
End If
End If
End Sub
This is displaying an error, can someone tell me where I have gone wrong? What I want in this search form is the ability to type the Title, Project, Date, Key words and Category, or just one of the following and push the search button which would bring up the results on the Lessons Learnt List Form. The format I would prefer would be
Title: (then a blank box to type)
Project: (then a blank box to type)
etc
If there is a better way to do it, how do I do it?
Also the next thing I would like to do is have the ability in the search to type in part of a word, or just a single key word which would bring up the results? I saw somewhere this was done by using a *(and then the characters) before pushing a search button.
If not how would I do a search and list for my table, as in when I start typing the results start showing matches etc.
Thanks Very Much, Hope I was clear enough. If anything is unclear let me know!
Cheers
I am currently trying to build a database that can search through specific lessons learnt for a company. I have started by building a table, which includes Title, Project, Date, Summary, Category, Attachments and Key Words. Next I created a split form called Lessons Learnt List, which includes the table and at the top has a button called new lesson. When this button is pushed it is linked to another form which pops up and is called Lessons Learnt Details which allows new lessons learnt to be added to the table. The save and exit button work fine. A new form was created called Lessons Learnt Search, this is where I am having the problem. I have created a text box and linked it the table and then created a button. The button has been given the code:
Private Sub Search_Click()
If IsNull(Title) = False Then
Me.Recordset.FindFirst '[Title]=' & Title
Me!Title = Null
If Me.Recordset.NoMatch Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
Me!Title = Null
End If
End If
End Sub
This is displaying an error, can someone tell me where I have gone wrong? What I want in this search form is the ability to type the Title, Project, Date, Key words and Category, or just one of the following and push the search button which would bring up the results on the Lessons Learnt List Form. The format I would prefer would be
Title: (then a blank box to type)
Project: (then a blank box to type)
etc
If there is a better way to do it, how do I do it?
Also the next thing I would like to do is have the ability in the search to type in part of a word, or just a single key word which would bring up the results? I saw somewhere this was done by using a *(and then the characters) before pushing a search button.
If not how would I do a search and list for my table, as in when I start typing the results start showing matches etc.
Thanks Very Much, Hope I was clear enough. If anything is unclear let me know!
Cheers