Making a text box searchable

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Roger (Roger_at_discussions.microsoft.com)
Date: 10/19/04


Date: Tue, 19 Oct 2004 10:43:01 -0700

I asked the qustion of how to make a text box searchable and I received the
response below. The only thing is when I search for an ID number, thats all
it brings up (It brings up a blank record with that ID number on it, there
are like 10 other fields, and I want all the information from the record to
show when I search). Is there a way to pull all the information by entering
the ID number? Is there something to add to this code to make it pull all
the information.

The way my database is set up is that I have 2 different forms, one form
(ID) is only used to add an ID number, the other form (Distribution List) is
used to add personel information to the ID number. Is there a way I can code
it so when I enter an ID number to the ID form, if that record already exists
it will automatically take me to that record in the Distribution List form,
and if that record does not exist it will take me to a new record with that
ID number? Is there any other way I might be able to accomplish this? You
need two controls for [ID]. Put one in the form header named IDFilter and
make it unbound (no ControlSource). Put the other one in the detail section,
bind it to the [ID] field and make it hidden.
 
In the AfterUpdate event of IDFilter have code...
 
Me.ID.DefaultValue = Chr(34) & Me.IDFilter & Chr(34)
Me.Filter = "[ID] = " & Me.IDFilter
Me.FilterOn = True
 
The way this works is the user enters the desired ID in the IDFilter control
and presses <Tab> or <Enter>. A filter is applied to show the record having
an ID value that matches their entry. If there is one found it will be
displayed. If there is not the form will display the blank (new record)
position and since the default value property has been set to the searched
for value any new record entered will have that value.



Relevant Pages

  • Re: Making a text box a find field.
    ... The way my database is ... You need two controls for. ... In the AfterUpdate event of IDFilter have code... ... If there is not the form will display the blank (new ...
    (microsoft.public.access.formscoding)
  • RE: value with check box
    ... the other nine form controls are meant to display other columns ... > with the names of your checkbox and combo box controls, ... >> I have set up a form with 10 fields set up as combo boxes. ... >> lose the ability to pull different values from source table, ...
    (microsoft.public.access.forms)
  • RE: value with check box
    ... It is highly unlikely that you need 10 combo boxes if they are displaying ... the other nine form controls are meant to display other columns ... > lose the ability to pull different values from source table, ...
    (microsoft.public.access.forms)
  • Re: Storage of html markup code in database
    ... UIs may include reports and database management tools, ... The details of your desired HTML-encoding may change over time. ... may also differ between display locations within your application. ... While it's unfortunate that the built-in controls are not ...
    (microsoft.public.dotnet.security)
  • RE: Display a record - several questions
    ... ObjectDataSource set up to get the correct record on a select. ... sub controls in the certain tepmlate and modify them. ... How do I display a RadioButtonList and CheckBox value where it is ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)