473,748 Members | 9,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search Number Two

OK folks I am having a serious brain fart here and can't get the code
to do what I really want done. I have a form that has a multi-table
query as its data source. The data is dsplayed on the form as a
series of text boxes and combo boxes. I want to have a button that
when clicked will search the previous control (as long as it is one of
the text boxes or combo boxes that contain data) for the text the user
requests. The search should only be performed on the data displayed
in the given previous control. If the previous control is a text box,
the serach should look for the requested text in the bound field. If
the previpous control is a combo box, the serach should look for the
requested text in the field displayed in the combo box, hoever I dont
want it to serach the available values in the combo box, I want it to
search the records for any who have the selected valeu containing the
search text. If it would help any I can put a hidden text box with
the displayed data element of the combo box somewhere on the form.
Anyone want to take a stab at this?

Thanks...

Feb 20 '07 #1
4 1756
DavidB wrote:
OK folks I am having a serious brain fart here and can't get the code
to do what I really want done. I have a form that has a multi-table
query as its data source. The data is dsplayed on the form as a
series of text boxes and combo boxes. I want to have a button that
when clicked will search the previous control (as long as it is one of
the text boxes or combo boxes that contain data) for the text the user
requests. The search should only be performed on the data displayed
in the given previous control. If the previous control is a text box,
the serach should look for the requested text in the bound field. If
the previpous control is a combo box, the serach should look for the
requested text in the field displayed in the combo box, hoever I dont
want it to serach the available values in the combo box, I want it to
search the records for any who have the selected valeu containing the
search text. If it would help any I can put a hidden text box with
the displayed data element of the combo box somewhere on the form.
Anyone want to take a stab at this?

Thanks...
So, let me see if I understand this... you want to know what control the
user previously hit before clicking the command button, and base a query
off that?

This could be fun, if your a bit masochistic (^:

Off the top of my head, this sounds like a fun code project. Create a
global variant in the form's code module to store a control's value.
Next in each of the subject controls you will need to write code in the
Lost_Focus event that stores the value of the control that was exited.

When the button fires, code must build a query to execute on the fly
using the stored value. Since the input type can vary (alpha, numeric,
or Null) you will probably need to build some decision making to create
the query syntax appropriately.

Note also, someone might hit the button without having exited a subject
control, and you will need to account for this also.

Having said all that, this seems an awkward and unintuitive way (from a
user's perspective) to build a query. What's behind this?

--
Smartin
Feb 21 '07 #2
Smartin wrote:
So, let me see if I understand this... you want to know what control
the user previously hit before clicking the command button, and base
a query off that?

This could be fun, if your a bit masochistic (^:

Off the top of my head, this sounds like a fun code project. Create a
global variant in the form's code module to store a control's value.
Next in each of the subject controls you will need to write code in
the Lost_Focus event that stores the value of the control that was
exited.
Or the button's code could just use...

Screen.Previous Control

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Feb 21 '07 #3
In article <m6************ *******@newssvr 21.news.prodigy .net>,
ri*********@hot mail.com says...
Smartin wrote:
So, let me see if I understand this... you want to know what control
the user previously hit before clicking the command button, and base
a query off that?

This could be fun, if your a bit masochistic (^:

Off the top of my head, this sounds like a fun code project. Create a
global variant in the form's code module to store a control's value.
Next in each of the subject controls you will need to write code in
the Lost_Focus event that stores the value of the control that was
exited.

Or the button's code could just use...

Screen.Previous Control

I know how to use previuoscontrol and in fact my object naming
convention is such that it is easy for me to determine if the previous
control was a text box, combo box, or other object. Other objects would
give the user a message to pick an appropriate field to search on. That
all I have down. What I dont know how to do is simulate the search
functionality of the built in search in access. the find, find next,
etc AND how to do that not only on a text box on the calling form but
also on a combo box (searching on the displayed value rather than the
stored value.
Feb 21 '07 #4
On Feb 20, 9:03 pm, Swans, What Swans? <f...@barkingpu mpkin.ooo>
wrote:
In article <m6NCh.46950$Gr 2.30...@newssvr 21.news.prodigy .net>,
rickbran...@hot mail.com says...


Smartin wrote:
So, let me see if I understand this... you want to know what control
the user previously hit before clicking the command button, and base
a query off that?
This could be fun, if your a bit masochistic (^:
Off the top of my head, this sounds like a fun code project. Create a
global variant in the form's code module to store a control's value.
Next in each of the subject controls you will need to write code in
the Lost_Focus event that stores the value of the control that was
exited.
Or the button's code could just use...
Screen.Previous Control

I know how to use previuoscontrol and in fact my object naming
convention is such that it is easy for me to determine if the previous
control was a text box, combo box, or other object. Other objects would
give the user a message to pick an appropriate field to search on. That
all I have down. What I dont know how to do is simulate the search
functionality of the built in search in access. the find, find next,
etc AND how to do that not only on a text box on the calling form but
also on a combo box (searching on the displayed value rather than the
stored value.- Hide quoted text -

- Show quoted text -
David:

Take a look at the FindRecord Action in help for dealing with
searching for records. Note that the field you're going to search in
has to have the focus. Combo boxes are only searchable on the stored
value as far as I know, though you can get what the displayed text of
a combo box is by using the Column property of your combo box if you
want to search some other text field for the displayed text. The
counting of columns is zero based, so column 1 is really 0 and column
2 is 1. So, if you wanted to grab the displayed text of a 2 column
combo box and the first column is your bound column and the second
column is the displayed text, you'd use something like this in your
code:
stMyDisplayedTe xt = Me.MyComboBoxNa me.Column(1)

HTH,
Jana

Feb 21 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5771
by: Phil Powell | last post by:
The table already has a fulltext index and from there I can use the MySQL fulltext search query to get results as well as the relevancy score. The problem I have is that MySQL has a default setting whereby the minimum amount of characters is 4 for a search. Being that we're government and full of TLA (three-letter acronyms), that is not practical, and furthermore, the app I'm building must be fully portable, so having MySQL tweaked...
2
3534
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned from my search and how many records I have set it to display per page. All great so far, HOWEVER..... When you click the next link to see the next 10 results on the next page, it just dumps the search details and pulls up all the records in the...
0
3663
by: todd | last post by:
here is a search tool SP I wrote. How many times have you wanted to search all your Stored procs or views (in a database) for a keyword but couldn't!? Well now you can! THis can makes life a lot easier for developers. Would you email me and let me know which part of the world my code is running in?
1
1790
by: disaia | last post by:
2 problems: Example: If a person types in a part number into Yahoo: 1. Is there a way for Yahoo to list your web site as one of the results. 2. If the user clicks on your link, can your web application know the part number the user typed into the Yahoo search box. I would like to use that part number to query our database and present a dynamic web
1
1609
by: damjanu | last post by:
Dear All; I have 3 issues 1) On some of my tables I have unique indexes, so that for example no two phone numbers can be the same. When user enters phone number that already exists, a scary error comes up with error number telling him that it is a duplicate. I would like to catch this error number xxxx and handle it so that I stop execution,
1
2723
by: Eric | last post by:
Hi: I have two files. I search pattern ":" from emails text file and save email contents into a database. Another search pattern " field is blank. Please try again.", vbExclamation + vbOKOnly Me.txtEmail.SetFocus Exit Sub End If Me.txtStatusBar.Value = "Parsing..." strEmail = Me.txtEmail.Value
2
1510
by: Robert Jacobs | last post by:
Please Help! I have read over and over again to go to Allen Browne's website to filter subforms, but I just don't understand it, and I can't get it to work in my situation. Any advice is very appreciated. I have 2 forms. Mainform=Customers Subform(linked)=Service Requests. The two forms have a one to many relationship (many service requests
2
3009
by: parasuram | last post by:
Hi friends ............. this is a question regarding the data structures trees Pleas post it if possible with in 2 days I will thankful if some body could help doing this. Operating system: windows xp compiler : Dev c++ Question is as folllows : Genaration of keys : Assume that your keys are character strings of length 10 obtained by scannig a c++ program. If a string has less than 10 characters make it up to 10 characters by...
13
2119
by: jfarthing | last post by:
Hi everyone! I am using the script below to search a db. If the is more than one match in the db, all goes well. But if there is only one match in the db, nothing gets displayed. Any suggestions will be greatly appreciated. Jim #! /usr/bin/perl -w use strict;
3
1849
by: mercuryshipzz | last post by:
#!/usr/bin/perl #use strict; use warnings; sub search_pattern { my $file_name = $_;
0
8831
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.