Link to home
Start Free TrialLog in
Avatar of sherman6789
sherman6789Flag for United States of America

asked on

How can I search for an "Auto ID" number?

Hello,

We need to be able to search for a particular Auto ID number.  For this project, the office uses the automatic ID number assigned by Access as the ID number.  We realize that the number will not be repeated even if it is deleted.  We have over 4,000 records in this table and they are referenced by ID number rather than name, Social Security Number, etc.

We also need to have a search button that is better than the one that the wizard creates in Access.  It needs to look only in FieldA and FieldD.  It should look anywhere in these two fields and should be non-case sensitive.  A find next and/or clear would be helpful but not required.

Any assistance that you can give will be appreciated by all of us.

WRS
SOLUTION
Avatar of shanesuebsahakarn
shanesuebsahakarn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sherman6789

ASKER

Thanks for your swift response, as usual:  shanesuebsahakarn

Yes, the search fields will be on the current screen.  Lately, I have been designing all-in-one screens that have most of the information on one screen.  This helps the user avoid switching back and forth from menu (switchboard) to result screens.  The exceptions are print menu screen and certain merge functions.

Your question reminded me that I may need the ability to search from one form and then press a button to have the resultant screen pop up.

Thanks again.

-William Sherman
Let me know if you have any problems with it and I will do my best to help.
Thanks,

I'll work on it tonight.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It very much depends on whether you want the user to be able to navigate away from the matched record (using default or your own navigation buttons). A filter will pare down the recordset to only the matched record(s), and a find will move to the (first) matched record within the existing recordset.
Thanks shanesuebsahakarn and nico5038,

I believe that I confused the issue by asking two questions at the same time.  I thought that they were related.

How do I add a feature to my form that allows me to type an ID number and that record immediately appears on the screen?  The form shows all needed information for the current record.  Navigation and search buttons are at the bottom of the form.  We are using the Autonumber feature as the item ID.

You both seem to have offered suggestions on the second question.  I am working on it now.

Thanks for your help.

WRSherman
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks nico5038 for the information about searching autoID numbers.  I am keeping this post open a little longer incase I have additional questions about searching the two fields.

Before I close it, I plan to increase the points from 200 to 300 and split them between nico5038 and shanesuebsahakarn.

Thank you both.

WRSherman
Points have just been increased to 400.

WRSherman
Good morning,

I've had time to think about my requests  and to evaluate your replys.  I am still confused because I don't know exactly where to put some of the code.  Let me restate that there are two requests.

1.  I have about 3000 records in a database.  Records in the main table (tblCommunityAware) are used on the main form  (frmCommunityAware).

2.  The form displays items such as: Organization, ContactName, eMail, Costs, Type, etc.  At the bottom of the form are navigation buttons: (First, previous, next, last); plus other buttons: (Add, Delete, Save, and Exit).

3.  The normal MS search button is used to find records based on the information placed in the pop-up dialog box.  This Access generated search box is not very easy for users because they must remember to change the criteria to "any part of field", select case sensitivity, etc.  Also, if the user wants only a certain field searched, he or she must click in that field first or select from the list to find it.  That is why my original 2nd question was to develop a special search button which would automatically only look in two specified fields for search purposes.

4.  Frequently, the user knows the ID number of the item needed for an update.  My first questions was for the user to be able to enter an ID number somewhere on the form then hit Enter or click a button and the current form will immediately contain the information associated with the ID entered.  The ID is an auto field.  The items are presented in ID number order.  If the user wants to enter "412", I want item ID 412 to appear on the form.

You may have already understood these requests from the beginning.  I restated it because I wanted to be sure that I understood what I wanted as well as to give you all of the data that I think you needed at this point.  Please forgive me, if I was too redundant.

Thanks!

WRSherman
Normally I create a main form with a datasheet subform holding the table rows.
Now the Add/Update/Delete buttons are placed on the mainform and can act on the selected row from the datasheet.
As the datasheet subform can be sorted by ID number, the ID number selection isn't that much needed as the user can scroll to the row easily.
The right-click mechanism will also allow another sort and/or filtering. I made a small instruction document for my users so I don't have to code sort/filter buttons. (Drop me a line and I'll mail it, see my profile for the address)

The filtering code for the two fields can be placed behind a button and will make the datasheet subform to show only rows with "hits".

Clear ?

Nic;o)
Thanks again for clarifying.  This information will come in handy for one of my databases and I will be able to use it in many of the future tables for searching.  The current project has all of the information about a record on the screen at one time and the user does not have to scroll through numbers that are close to each other.  As an example:  The user may be working on record 17 and may need to skip to record 725 or 1218.  Scrolling may not be as convenient as just typing the need record number in a box, pressing a button and the record's information fills the form which is already on the screen.  I do like the idea of the subform on some of my other projects but not this one.

What is a good way to be able to type the number and go directly to that record.  Remember that the number in question is an autonumber and it is the key field.  I don't know if autonumbers are considered number fields, text fields or some other special fields.

Can the information above be used to accomplish this?

and YES! the previous information was presented very clear.

I will respond and request your instruction document that you mentioned above.

Thanks again.

WRSherman