![]() |
|
|
#1
|
|||
|
|||
|
i made a search form with 4 unboud search-boxes (company, first name, last name, city) and 2 buttons : clear fields and search contact
i set the deffaultvalue for every search-box to "" then for the clear fields button i used: Private Sub clear_fields_Click() Me.company.Value = "" Me.fname.Value = "" Me.lname.Value = "" Me.city.Value = "" End Sub and for the searchcontact button i used: Private Sub search_Click() DoCmd.OpenQuery "contacts extended2", acViewNormal End Sub then in the contacts extended2 query i set the criteria for the compaby, fname, lname and city field to this: Like [forms]![Frmsearchcontacts].[*search-box name*] & "*" i dont know what i did do wrong? can anyone help me with this please? regards, Sam |
|
#2
|
||||
|
||||
|
Like [forms]![Frmsearchcontacts].[search-box name] & "*"
or Like [forms]![Frmsearchcontacts].[search-box name] + "*"
__________________
How to Mark a thead solved: http://www.accessforums.net/forum-su...lved-1828.html Contact for Solutions to your database problems and at affordable rates silverback_bats@yahoo.co.in |
|
#3
|
|||
|
|||
|
when i use:
Like [forms]![Frmsearchcontacts].[searchbox-name] & "*" i have to enter a parametervalue when i use: Like [forms]![Frmsearchcontacts].[searchbox-name] + "*" the query returns empty? any other suggestions? Sam |
|
#4
|
|||
|
|||
|
the parameter value dialog box usually means you misspelled something. make sure your spelling and capitilization are correct.
__________________
SELECT * FROM Users WHERE clue > 0 no results ![]() ----------------- I am Spartacus... true story |
|
#5
|
|||
|
|||
|
thanks for your post.
i did that. i also changed the names of the search boxes to be sure. now the query works for one search, and on another search it returns empty?? i'll add the db if you want to take a look. i would appreciate it. Sam |
|
#6
|
|||
|
|||
|
the solution to the problem is:
Like [forms]![Frmsearchcontacts].[*search-field name*] & "*" Or Is Null thanks for the help
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create combo search form in subform | grant.smalley | Forms | 6 | 02-19-2010 01:37 AM |
Dlookup in form doesn't work when I validate a defaultvalue from previous record
|
daniel.preda | Forms | 2 | 11-04-2009 06:45 PM |
| Search form with a date range | mantro174 | Forms | 1 | 02-11-2009 07:45 PM |
| Refresh form search text box | oxicottin | Forms | 2 | 11-19-2007 11:28 AM |
| Search for record from a form | hcoakley | Forms | 0 | 11-26-2006 08:23 AM |