Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Forms

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-06-2010, 07:29 AM
sams sams is offline Windows Vista Access 2007 (version 12.0)
Novice
 
Join Date: May 2010
Location: Mayrhofen, Tirol, Austria
Posts: 12
sams is on a distinguished road
Send a message via MSN to sams Send a message via Skype™ to sams
Default my search form won't work?

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
Reply With Quote
  #2  
Old 05-06-2010, 08:04 AM
maximus's Avatar
maximus maximus is offline Windows 7 Access 2010 (version 14.0)
Wizard
 
Join Date: Aug 2009
Location: India
Posts: 804
Blog Entries: 1
maximus is on a distinguished road
Default

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
Reply With Quote
  #3  
Old 05-06-2010, 08:27 AM
sams sams is offline Windows Vista Access 2007 (version 12.0)
Novice
 
Join Date: May 2010
Location: Mayrhofen, Tirol, Austria
Posts: 12
sams is on a distinguished road
Send a message via MSN to sams Send a message via Skype™ to sams
Default

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
Reply With Quote
  #4  
Old 05-06-2010, 09:48 AM
TheShabz TheShabz is offline Windows XP Access 2003 (version 11.0)
Court Jester
 
Join Date: Feb 2010
Posts: 511
TheShabz is on a distinguished road
Default

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
Reply With Quote
  #5  
Old 05-06-2010, 10:29 AM
sams sams is offline Windows Vista Access 2007 (version 12.0)
Novice
 
Join Date: May 2010
Location: Mayrhofen, Tirol, Austria
Posts: 12
sams is on a distinguished road
Send a message via MSN to sams Send a message via Skype™ to sams
Default

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
Attached Files
File Type: zip test db 1.zip (81.7 KB, 4 views)
Reply With Quote
  #6  
Old 05-06-2010, 12:08 PM
sams sams is offline Windows Vista Access 2007 (version 12.0)
Novice
 
Join Date: May 2010
Location: Mayrhofen, Tirol, Austria
Posts: 12
sams is on a distinguished road
Send a message via MSN to sams Send a message via Skype™ to sams
Default

the solution to the problem is:

Like [forms]![Frmsearchcontacts].[*search-field name*] & "*" Or Is Null

thanks for the help
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -8. The time now is 01:42 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.