MS Access

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



Go Back   Tutorialized ForumsDatabasesMS Access

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 1st, 2014, 08:51 PM
mithu1992 mithu1992 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Sep 2013
Posts: 2 mithu1992 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 11 sec
Reputation Power: 0
Microsoft Access Searchbox Help

(1) I have a Table called Account table [ ID, ACCode, ACName, Date]
(2) a form called Account form
(3) a sub-form called Account subform –Record Source to Account Table
(4) Account form is single form with Account subform

In Account Form


I have a Search box - txtSearch
A command button cmdSearch
cmdSearch – onclick event got the following code :

Private Sub cmdSearch_Click()
Dim bkmk As Variant
Dim strField As String
Me.RecordsetClone.MoveFirst
'Find the first record that matches what
'is in the search text box.
Me.RecordsetClone.FindFirst "ACName Like " & Chr(34) & Me.txtSearch & "*" & Chr(34)

If Me.RecordsetClone.NoMatch Then
MsgBox " Sorry! No match found for [" & Me.txtSearch & "], Try another ", vbOKOnly + vbInformation, "Sorry"

Me.txtSearch.SetFocus
Else
bkmk = Me.RecordsetClone.Bookmark
Me.Recordset.Bookmark = bkmk
End If
Me.txtSearch = ""
End Sub


This code works to fine search single record. I can find any single item either ID, or ACCode or Date. Message also works if no match found. Even just put one word, two word …or whole word.
But I want to search multiple records from the same box (txtSearch).
(1) Actually I want to put multiple criteria in here - Me.RecordsetClone.FindFirst "ACName Like " & Chr(34) & Me.txtSearch & "*" & Chr(34) So that it can find either ID or ACCode or ACName
(2) Another thing is –If no item put the search box it will show a message “No search item has detected”

Can anyone help me please?

Thanks.

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesMS Access > Microsoft Access Searchbox Help


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 - 2017, Jelsoft Enterprises Ltd.

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