Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 6th, 2008, 07:11 AM
ahwilgor ahwilgor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 4 ahwilgor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 23 sec
Reputation Power: 0
Access 2007 search box within form

Hi there,

I'm a bit of a novice in terms of access 2007 and know nothing about VBA. I was hoping someone could help me out with this small query - probably you may even think it not worthy of a post, but it i'm at a lost and need help.

I have created a table called Candidates. It's fields include firstname, lastname, address, telnumber, etc - that kind if stuff. I have also created a split form from this table. This form is meant so that the users can update the data onto the database. So far so good.

However, i want to create (in the header section of my Candidate form) a search function of the records, so that even when i am viewing a record (of say Candidate 1) and i want to go to another (say candidate 99), i just type the lastname of the Candidate in the search box and that particular form comes up. I'm not looking for a search report or a search subform which then gives me something else - i would just like the record to pop up so i can view amend it.

I have tried setting up a query to search for last names, but am getting nowhere. i see other examples and the end result is a sub-form with the search results - not really what i want.

Can someone please tell me how it's done? sorry if it sounds a little trivial to some of you, but it your reply would be very helpful.

thanks

Reply With Quote
  #2  
Old November 6th, 2008, 10:18 AM
dykebert's Avatar
dykebert dykebert is offline
Contributing User
Click here for more information
 
Join Date: Apr 2008
Posts: 429 dykebert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 Days 30 m 5 sec
Reputation Power: 7
I don't have 2007, but the following works for 2003 and earlier so it should be at least similar for 2007. I think the main difference is that in 2007 the properties box is one of the side windows instead of a pop up window.

To view the header for a form:

1. open the form in Design View
2. At the top of the form (just under the ruler bar), on the left, you will either see 'Form Header' or 'Detail'.
3. If you only see 'Detail' right-click on the 'Detail' bar. (This will bring up some options like: "Build Event'; 'tab order'; etc.)
4. Click on the 'Form Header/Footer' option near the bottom of the list.

Now your form will have three sections: Form Header; Detail; Form Footer.

In the header section add a text box and two buttons.

When you add the buttons and the wizard comes up just choose cancel since you will be adding your own code.

You will need to know the name of the text box you create so click on the text box. If the 'Properties box' is displayed, check what the name is. It will be the word text and a number like Text5 or Text33.

If the Properties box is not displayed, right-click on the text box and then choose 'Properties' at the bottom of the list.

Once you have the name of the text box it is time to work on the buttons.

You want to change what is displayed on the buttons. One of the buttons will be Filter and one will be Undo Filter.

Click on the button that you want to the be the 'Filter' button.
In the Properties box change the Caption to the word Filter.

Now you are going to add the code to the button.

Right-click on your 'Filter' button and select 'Build Event'.
Choose 'Code Builder' and click OK

This will bring up a whole different screen and you'll see something like:

Private Sub Command12_Click()

End Sub

You want to add the following lines before the 'End Sub'

Me.Filter = "<lastNamefield> = " & Me.<textboxName>
Me.FilterOn = TRUE
Me.Requery

so it will look like this:

Private Sub Command12_Click()

Me.Filter = "<lastNamefield> = " & Me.<textboxName>
Me.FilterOn = TRUE
Me.Requery

End Sub

You will need to replace <name> with the appropriate name from your table/form.

Now go back to your form.

For the other button:

Click on the button and change the Caption to read 'Undo Filter'

Right-click on the Undo Filter button and choose Build Event
Choose Code Builder

This time you are only going to add two lines of code:

Me.FilterOn = False
Me.Requery

Save the form.

When you open the form you should have a textbox at the top and two buttons (Filter, Undo Filter)

You should be able to enter your incident number into the text box and then click the Filter button to see that record.

Hope this make sense!
__________________
P.S. I am looking for work. <grin>.

Reply With Quote
  #3  
Old November 7th, 2008, 06:14 AM
ahwilgor ahwilgor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 4 ahwilgor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 23 sec
Reputation Power: 0
Many thanks mate. i'll give this a go. Good luck with the job search!

Reply With Quote
  #4  
Old October 19th, 2009, 01:35 AM
nkk nkk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 2 nkk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 38 sec
Reputation Power: 0
Hey dykebert,

I stumbled across this thread and am trying to do a similar thing.

I'm creating a vaccination records database

So I've created a split form and as I enter the data it automatically stores it in the table below the form. Also before creating the split form I created a table with a bunch of fields entered and used that table to create the form.

So now say a child comes in on a return visit, I want to put a search box on the split form so that I simply search the child's name or by his/her unique vaccination card number and the form autopopulates with all the data previously entered (possibly bio data and vaccines already administered).

I tried what you described. This is what I code looks like:

Private Sub Command86_Click()

Me.Filter = "<ID>=" & Me.<ID>
Me.FilterOn = True
Me.Requery


End Sub

Private Sub Command87_Click()

Me.FilterOn = False
Me.Requery

End Sub



I'm hoping to search by the child's ID.
But as soon as I type the above code in it gives me this error

Compile error:
Expected: identifier or bracketed expression



I'm so confused! Please help. Thanks so much!

Reply With Quote
  #5  
Old October 19th, 2009, 01:51 AM
nkk nkk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 2 nkk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 38 sec
Reputation Power: 0
could i please possibly email you my database?

Reply With Quote
  #6  
Old November 10th, 2009, 09:55 AM
BWC BWC is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 4 BWC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 44 sec
Reputation Power: 0
Help Creating a filter form or report

I am trying to create a form or report, which ever is easier, to search a particular table or group of tables. I want to be able to search any particular field from the table and it bring up that row from the table. My fields on my table are: Document/Form, Section Title, Origination Date, Revision Number, Revision Date, Reason for Revision, and Procedure Link.

I word prefer it to look like a form in which you could enter information but perform a search instead on whatever information the person knows.

I have messed with coding some but can't figure it out.

Any help and suggestions would be of great help!

Reply With Quote
  #7  
Old November 10th, 2009, 04:45 PM
AlanSidman's Avatar
AlanSidman AlanSidman is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Lake County, IL
Posts: 240 AlanSidman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 49 m 19 sec
Reputation Power: 7
Look at this tutorial

http://www.datapigtechnologies.com/flashfiles/buildcustomfilter.html

Alan
__________________
Alan Sidman
__________
If I helped you, I'd like to know. Click on the icon next to the thread number and tell me.

Reply With Quote
  #8  
Old March 26th, 2010, 11:45 AM
wcstarks wcstarks is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 2 wcstarks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 8 m 29 sec
Reputation Power: 0
Adding a Search to a Form

Hello,

I tried as explained below but get an error when I attempt to perform the filter query.

Access 2007
My table is a catalog of DVD movies
My table field name is "Title"
My form is also a split form
My text box control is named "MySearch"

The code for the filter button is as suggested:

Private Sub Command22_Click()
Me.Filter = "Title = " & Me.MySearch
Me.FilterOn = True
Me.Requery
End Sub

When this runs I get the following error for the line Me.Filter =.
Run-time error '3075':
In operator without () in query expression 'Title = Men in black'.

I cannot figure out how to get this code to work. Any Help would be greatly appreciated?




Quote:
Originally Posted by dykebert
I don't have 2007, but the following works for 2003 and earlier so it should be at least similar for 2007. I think the main difference is that in 2007 the properties box is one of the side windows instead of a pop up window.

To view the header for a form:

1. open the form in Design View
2. At the top of the form (just under the ruler bar), on the left, you will either see 'Form Header' or 'Detail'.
3. If you only see 'Detail' right-click on the 'Detail' bar. (This will bring up some options like: "Build Event'; 'tab order'; etc.)
4. Click on the 'Form Header/Footer' option near the bottom of the list.

Now your form will have three sections: Form Header; Detail; Form Footer.

In the header section add a text box and two buttons.

When you add the buttons and the wizard comes up just choose cancel since you will be adding your own code.

You will need to know the name of the text box you create so click on the text box. If the 'Properties box' is displayed, check what the name is. It will be the word text and a number like Text5 or Text33.

If the Properties box is not displayed, right-click on the text box and then choose 'Properties' at the bottom of the list.

Once you have the name of the text box it is time to work on the buttons.

You want to change what is displayed on the buttons. One of the buttons will be Filter and one will be Undo Filter.

Click on the button that you want to the be the 'Filter' button.
In the Properties box change the Caption to the word Filter.

Now you are going to add the code to the button.

Right-click on your 'Filter' button and select 'Build Event'.
Choose 'Code Builder' and click OK

This will bring up a whole different screen and you'll see something like:

Private Sub Command12_Click()

End Sub

You want to add the following lines before the 'End Sub'

Me.Filter = "<lastNamefield> = " & Me.<textboxName>
Me.FilterOn = TRUE
Me.Requery

so it will look like this:

Private Sub Command12_Click()

Me.Filter = "<lastNamefield> = " & Me.<textboxName>
Me.FilterOn = TRUE
Me.Requery

End Sub

You will need to replace <name> with the appropriate name from your table/form.

Now go back to your form.

For the other button:

Click on the button and change the Caption to read 'Undo Filter'

Right-click on the Undo Filter button and choose Build Event
Choose Code Builder

This time you are only going to add two lines of code:

Me.FilterOn = False
Me.Requery

Save the form.

When you open the form you should have a textbox at the top and two buttons (Filter, Undo Filter)

You should be able to enter your incident number into the text box and then click the Filter button to see that record.

Hope this make sense!

Reply With Quote
  #9  
Old April 19th, 2012, 08:43 AM
Kipi78 Kipi78 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 4 Kipi78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 14 sec
Reputation Power: 0
Hi
I tried using the suggest code above. On one form it worked perfectly but, when I tried it in another database, I enter my search request and click the "Filter" button I then get a popup "Enter Parameter Value" box asking for the parameter agian. I would like to enter the parameter once on the form header and have it search from there. How do I stop the "Enter Parameter Value" popup box from coming up?
Thanks
Kip

Reply With Quote
  #10  
Old April 19th, 2012, 08:07 PM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
nkk, use [] instead of <>. The <> were intended to mean 'use your field name here'. Use [] to delimit names, especialy when spaces or special characters or punctuation (underscores are exception) are in the name or reserved word is used as name.

wcstarks, when field is text datatype, enclose criteria in apostrophe delimiters (dates use #, numbers nothing):
Me.Filter = "Title = '" & Me.MySearch & "'"

kipi78, the prompt pops up because Access isn't finding the referenced item - misspelled, wrong syntax.
__________________
I like to know if my suggestion helped you. One way to let me know is by clicking scales at top right corner of post.
Debug!Debug!Debug!http://www.cpearson.com/excel/debug.htm

Last edited by June7 : April 19th, 2012 at 08:09 PM.

Reply With Quote
  #11  
Old April 20th, 2012, 10:04 AM
Kipi78 Kipi78 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 4 Kipi78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 14 sec
Reputation Power: 0
Quote:
Originally Posted by June7
nkk, use [] instead of <>. The <> were intended to mean 'use your field name here'. Use [] to delimit names, especialy when spaces or special characters or punctuation (underscores are exception) are in the name or reserved word is used as name.

wcstarks, when field is text datatype, enclose criteria in apostrophe delimiters (dates use #, numbers nothing):
Me.Filter = "Title = '" & Me.MySearch & "'"

kipi78, the prompt pops up because Access isn't finding the referenced item - misspelled, wrong syntax.


Thanks! You are the best....

Reply With Quote
  #12  
Old April 20th, 2012, 11:14 AM
KMendels KMendels is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 1 KMendels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 17 sec
Reputation Power: 0
Quote:
Originally Posted by June7
kipi78, the prompt pops up because Access isn't finding the referenced item - misspelled, wrong syntax.

June7 - I had the exact same problem and don't see anything misspelled or wrong syntax. I pretty much copied the code from Dykebert and added my control names but they aren't misspelled.

The filter works, but that annoying prompt still pops up.

Reply With Quote
  #13  
Old April 20th, 2012, 12:42 PM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
KMendels, something somewhere in the query or on form is referencing something that Access can't find.

I would have to examine the project.

Last edited by June7 : April 20th, 2012 at 03:31 PM.

Reply With Quote
  #14  
Old April 23rd, 2012, 08:39 PM
Kipi78 Kipi78 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 4 Kipi78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 14 sec
Reputation Power: 0
Building on this search box code. How do I perform a search with partial criteria? I think it is called a wildcard search, for example seacrch the name field for all names containing the characters "an" and getting the results... "Joann", "Ryan" ... etc.
Thanks Kip

Reply With Quote
  #15  
Old April 24th, 2012, 08:41 PM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
Criteria under field:

Like "*an*"

Like "*" & Forms!formname!controlname & "*"

Reply With Quote
  #16  
Old April 25th, 2012, 08:30 PM
Kipi78 Kipi78 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 4 Kipi78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 14 sec
Reputation Power: 0
Quote:
Originally Posted by June7
Criteria under field:

Like "*an*"

Like "*" & Forms!formname!controlname & "*"


I am receiving an error with the following code.

Me.Filter = tblShareholderCertificateName = "'" Like " * " & Me.txtSearch & " * " & "'"

I cant seem to get the correct syntax. I am new to VBA, is there is a resource with syntax available? Any help is appreciated. Thanks

Reply With Quote
  #17  
Old April 26th, 2012, 03:41 AM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
Try:

Me.Filter = tblShareholderCertificateName Like "*" & Me.txtSearch & "*"

Or might need the apostrophe delimiters
Me.Filter = tblShareholderCertificateName Like "'*" & Me.txtSearch & "*'"

Last edited by June7 : April 26th, 2012 at 03:47 AM.

Reply With Quote
  #18  
Old May 15th, 2012, 07:51 PM
Faudman Faudman is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Faudman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 56 sec
Reputation Power: 0
I am having this issue as well. The form itself is bound to the table that search and results should be happening in.
The form has one text box(unbound), one button and then the field that should be updated(bound)
The code is
Code:

Private Sub Command13_Click()
Me.Filter = "Incident_number = " & Me.Text14
Me.FilterOn = True
Me.Requery
End Sub


The search does work, you just get a pop up every time. The pop up box has the string that is trying to be searched so if I am searching "test1" then I get a pop up box that says "test1" and so I write test1 again in the box and then the field shows up that I want to edit.

Reply With Quote
  #19  
Old May 16th, 2012, 12:51 PM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
Is Incident_number actually a text field? Try the text delimiters.

Me.Filter = "Incident_number = '" & Me.Text14 & "'"

Reply With Quote
  #20  
Old May 16th, 2012, 07:35 PM
Faudman Faudman is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Faudman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 56 sec
Reputation Power: 0
Amazing, you have fixed the problem. Thank you very much, am I to assume that this is because it is a text field? The only book I have is the Access 2000 bible and i was not able to find this in there.

Reply With Quote
  #21  
Old May 16th, 2012, 11:08 PM
Vernon245 Vernon245 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Vernon245 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 57 sec
Reputation Power: 0
Many thanks mate. i'll give this a go. Good luck with the job search!

Reply With Quote
  #22  
Old May 18th, 2012, 07:01 PM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
Yes, criteria for text fields need apostrophe delimiter. Date fields need # delimiter.

Reply With Quote
  #23  
Old June 11th, 2012, 08:36 AM
IAMNewbie IAMNewbie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 2 IAMNewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 35 sec
Reputation Power: 0
Hi All

Hello guys,

I have simple search form also and tried to follow the steps mentioned in this thread. Unfortunately, I can't make my search button work.

Database:
tblFirst
tblSecond

Split Form Details:
[Header Section]
1 Textbox - txtSearchItem
1 Button - btnSearch

[Detail Section]
Record Source - tblFirst, tblSecond WHERE tblFirst.fld1 = tblSecond.ID
(means, ID is FK in tblFirst)

I just wanted that the Detail section will display only records I want to see after clicking the Search button. (Of course!)

My code:

Private Sub btnSearch_Click()
Me.Filter = "fldName = '" & Me.txtSearchItem & "'"
Me.FilterOn = True
Me.Requery
End Sub


When I click the button, nothing happens. Did I missed something or I made something wrong? Thanks for any help.

Reply With Quote
  #24  
Old June 12th, 2012, 04:48 AM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
Does the Click event property of the button have [Event Procedure]?

fldName is the actual name of a field in the form's RecordSource?

Reply With Quote
  #25  
Old June 12th, 2012, 07:31 AM
IAMNewbie IAMNewbie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 2 IAMNewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 35 sec
Reputation Power: 0
Hi June7!

Thank you for your reply. I actually solved my problem. Maybe others have same problems like me also. It is not a code issue but my Access Trust Location & Publisher Settings ! No matter what I placed in my btnSearch button [Event Procedure], nothing happens, but thru UI, i dont have problems. It is bec of these settings.

Right now it is working using code. Thank you very much for this thread. It did help me ) !

Reply With Quote
  #26  
Old June 27th, 2012, 06:44 AM
testeron testeron is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 8 testeron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m 38 sec
Reputation Power: 0
another question

i try all above and nothing happend, i created the code, and every thing looks ok.
but when i press the buttom, nothing happend.
i verify that the field name is exactly like in my table.
i also verify that my DB is secured like the advice of someone here.

here are my code lines :
Private Sub Command62_Click()
Me.Filter = "Titel = '" & Me.Text60 & "'"
Me.FilterOn = True
Me.Requery
End Sub

now one thing was up in my mind, i am looking for a field in my table and not on my form.
sorry if it is stupid question, but i am very new to Access.

TNX Eyal

Reply With Quote
  #27  
Old June 28th, 2012, 03:27 AM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
If Titel (misspelled?) is not in the form's RecordSource then code won't work.

Reply With Quote
  #28  
Old June 28th, 2012, 03:36 AM
testeron testeron is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 8 testeron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m 38 sec
Reputation Power: 0
Quote:
Originally Posted by June7
If Titel (misspelled?) is not in the form's RecordSource then code won't work.


thnaks, i have check it and this is the right field.

but i think that i know what is the mistake:
in the search creteria i did that the value will match exactly the field value.
i think i need to add something like "like" to find only part of the titel and not the exact value.
can you explain me how to do it?
i wrote the line Me.Filter = Titel Like "*" & Me.Text27 & "*"
but it is not working well.

TNX

Reply With Quote
  #29  
Old June 29th, 2012, 02:46 AM
June7's Avatar
June7 June7 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Location: The Great Land
Posts: 256 June7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 9 h 29 m 29 sec
Reputation Power: 5
Still need apostrophe delimiters. Try:

Me.Filter = "Titel Like '*" & Me.Text27 & "*'"

Reply With Quote
  #30  
Old June 29th, 2012, 07:17 AM
testeron testeron is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 8 testeron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 31 m 38 sec
Reputation Power: 0
Quote:
Originally Posted by June7
Still need apostrophe delimiters. Try:

Me.Filter = "Titel Like '*" & Me.Text27 & "*'"


Many Thanks, it really works now :-)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Access 2007 search box within form


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap