473,500 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i show result using search button where i am provide same value many time

2 New Member
i have a simple access from where i am create simple search button to find record.
search button works good, here is may question is,i want to create search button where i am just click the button & result show in form or list box or combo box.Where same value is providing many of time different department as different person as usual date was be different.
here is my problem i want to crate when i am searching value in my form than all same record show in form same time.

Here is my code i am using for text search option & it work s fine. please help me find out to solve this problem.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command73_Click()
  2.     Dim strStudentRef As String
  3.     Dim strSearch As String
  4.  
  5. 'Check txtSearch for Null value or Nill Entry first.
  6.  
  7.     If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
  8.         MsgBox "Please enter a value!", vbOKOnly, "Invalid Search Criterion!"
  9.         Me![txtSearch].SetFocus
  10.     Exit Sub
  11. End If
  12. DoCmd.ShowAllRecords
  13.     DoCmd.GoToControl ("WalletNumber")
  14.     DoCmd.FindRecord Me!txtSearch
  15.  
  16.     WalletNumber.SetFocus
  17.     strStudentRef = WalletNumber.Text
  18.     txtSearch.SetFocus
  19.     strSearch = txtSearch.Text
  20.  
  21. 'If matching record found sets focus in strStudentID and shows msgbox
  22. 'and clears search control
  23.  
  24.     If strStudentRef = strSearch Then
  25.         MsgBox "Match Found For: " & strSearch, , "Congratulations!"
  26.         WalletNumber.SetFocus
  27.         txtSearch = ""
  28.  
  29.     'If value not found sets focus back to txtSearch and shows msgbox
  30.         Else
  31.            MsgBox "Match Not Found For: " & strSearch & " - Please Try Again.", _
  32.             , "Invalid Search Criterion!"
  33.             txtSearch.SetFocus
  34.     End If
  35. End Sub
Jan 22 '15 #1
1 1307
twinnyfo
3,653 Recognized Expert Moderator Specialist
mdshakilahmmed,

I'm not exactly sure what you are asking in your question. You also include code, which you say works fine. Could you explain your question better?
Feb 25 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
2734
by: thebison | last post by:
Hi all, I hope someone can help with this relatively simple problem. I am building a timesheet application using ASP.NET C# with Visual Studio 2003.As it is only a protoype application, my...
0
2206
by: porky008 | last post by:
I need to add a search button to this and have no clue how to do it. Can some one please help me on this? import java.awt.*; import java.awt.event.*; import javax.swing.*; import...
1
1464
by: tagnum | last post by:
I noticed a strange behaviour in IE 6. Not sure whether it's a bug in my code or because of IE 6. I have written a search function using a standard search input box and search button. (HTML input...
7
2439
by: Jason1983 | last post by:
hi, iam using access for the first time and need help setting up search button on the form.i have employer and employee tables.so the employer table will be have many different groups of...
1
1357
by: Ledmark | last post by:
I have a database that uses four forms and each form has it's own table and each form has it's own search button to find a specific record within that table. I would like to use one search button...
22
21456
by: GoodGirl | last post by:
Hi : I would like to ask about : how can I write the (simplist) code for search button. I'm bignner in using Access 2007 & VBA . This button will search by name in a query which contains all...
3
2182
by: munkee | last post by:
Using Allen Brownes advanced filter I would like to add the option of an advanced search button. When this is clicked a popup opens with further search options. How would I go about joining the...
2
2676
by: Pamr | last post by:
My site is programmed with php and javascript. I have a search button which it searches records from my database. I have two different programming codes into the same file which retrieve data, the...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.