473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

small Ms access problem

6
Hi all,

I have created a form which gives the user the ability to search for specific data. Number of records in my database exceed one million records therefore in some occasion the searching takes an approximately a long time. Hence I have decided to show a hint message to inform the user that searching is going on and he has to wait. So in this regard I have created a label which is invisible at the beginning when the user presses the find button it becomes visible and when the searching is over it becomes invisible again. My big problem is that the label is not being showed or displayed when the user press the find button. The following codes might illustrate my problem. I would be much grateful if somebody can provide me with a hint or solution for my problem.

Note: even if I removed the lines which make my label invisible the label is only displayed when the search is over.

my code goes here
[
Private Sub cmd_find_Click()
Select Case og_search_elements
Case 1
strCriteria = "[phone_no] Like '" & txt_search & "'"
Case 2
strCriteria = "[name] Like '" & txt_search & "'"
Case 3
strCriteria = "[address] Like '" & txt_search & "'"
Case 4
strCriteria = "[phone_no] Like '" & txt_search & "'" _
& "or [name] Like '" & txt_search & "'" _
& "or [address] Like '" & txt_search & "'"

End Select

'display the searching label
Me.lbl_searching_msg.Visible = True

Set rst = [Forms]![frm_client_details].RecordsetClone


rst.FindFirst strCriteria

If rst.NoMatch Then

'Hide the searching label
Me.lbl_searching_msg.Visible = False
msgbox "No data has been found"
Else
[Forms]![frm_client_details].Bookmark = rst.Bookmark

'Hide the searching label
Me.lbl_searching_msg.Visible = False

End If

Set rst = Nothing
End Sub

]
Apr 14 '07 #1
1 1249
MMcCarthy
14,534 Expert Mod 8TB
Try this ...
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmd_find_Click()
  2.  
  3.    'display the searching label
  4.     Me.lbl_searching_msg.Visible = True
  5.  
  6.    Select Case og_search_elements
  7.         Case 1
  8.             strCriteria = "[phone_no] Like '" & txt_search & "'"
  9.         Case 2
  10.             strCriteria = "[name] Like '" & txt_search & "'"
  11.         Case 3
  12.            strCriteria = "[address] Like '" & txt_search & "'"
  13.         Case 4
  14.            strCriteria = "[phone_no] Like '" & txt_search & "'" _
  15.                  & "or [name] Like '" & txt_search & "'" _
  16.                  & "or [address] Like '" & txt_search & "'"
  17.  
  18.     End Select
  19.  
  20.    Set rst = [Forms]![frm_client_details].RecordsetClone
  21.  
  22.    rst.FindFirst strCriteria 
  23.  
  24.    If rst.NoMatch Then
  25.       msgbox "No data has been found"
  26.    Else
  27.         [Forms]![frm_client_details].Bookmark = rst.Bookmark
  28.  
  29.    End If
  30.  
  31.    'Hide the searching label
  32.    Me.lbl_searching_msg.Visible = False
  33.  
  34.     Set rst = Nothing
  35. End Sub
  36.  
  37.  
Apr 16 '07 #2

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

Similar topics

11
by: Bo Peng | last post by:
Dear List, It is not clear what the title means. :-) Here is the details: I need to manage a big bunch of small objects, like struct{ int a; int b; }obj;
16
by: mamo74 | last post by:
Hello. I am administering a SQL Server (Enterprise Edition on Windows 2003) from some month and can't understand what is going on in the latest week (when the db grow a lot). The DB is around...
5
by: F. Barth | last post by:
Hello, I've posted this problem to one other newsgroups, and gotten some diagnostic help, but I still need a solution. The full text of the message box is: "The field is too small to accept the...
49
by: Lauren Wilson | last post by:
Hi folks, Just wondered if, for the sake of clarity, it is permissible to post small image files of an error box along with a text message about a problem with Access?
24
by: Salad | last post by:
Every now and then I see ads that state something like "Experience with Large Databases ...multi-gig...blah-de-blah" And I have to laugh. What's the difference between a large or small database? ...
16
by: lawrence k | last post by:
I've a file upload script on my site. I just now used it to upload a small text document (10k). Everything worked fine. Then I tried to upload a 5.3 meg Quicktime video. Didn't work. I've...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
4
by: =?Utf-8?B?VzFsZDBuZTc0?= | last post by:
When one architects a new project one of the first steps in the decision is to decide on the layers. (In my opinion anyway) One architecture that I have used before is to go solid OO and create...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
9
by: Sidraa | last post by:
hello i hav come across this small problem...i made a small project using Access...now what happens is when i enter the data through a form it gets calculated by a query and then gets stored in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.