[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Access Programming (VERY LONG)



Per the several requests I got, here is my original question and the several
responses I got.  I've chosen to reprint them as is rather than summarize,
because I can barely understand them, much less condense it.  My thanks to
the respondents:

My question:

All I'm trying to do is create a query screen where a user can enter data in
a field and the program will spit back the data.  My problem is I can't seem
to figure out whether I need to create a form or not, and I don't see any
place on the menu where I would hit a button marked "search".

When I do this in DB/Textworks, my query screen is simply a set of search
fields; enter the data you want, hit the go button, and the program spits
back whatever matches the request.  I'm quite certain that Access does the
same, but I'm simply not understanding how searches in the DB work using
Access.  I have created query screens for the DB - my information is all
going in a central table, short of a few subtables I set up for the purpose
of Combo boxes, so I really only need to search one table for information.

_________________________
The responses:

Katherine Hayes:

If you're in a form, you can "query" it using filters. Read the HELP stuff
on filters. In Access, a "search" is really either a query or a filter. You
can filter by selection, or by form. If you're in a form, do the latter.
Clear the form and enter the query (search) data in the appropriate fields,
and then hit the Filter (funnel) button. This will return the records that
contain the data you are seeking. NOTE: you can't filter on data in
subforms. If this is part of your search, you'll need to create a query.

Questions that may determine your answer:
1. Is the user querying the data you're returning, or other data? if the
data used and returned is different, you need a query and form or report.
You can't really filter on subforms so you may need a query if the subform
info is part of the search. Search=query.
-- Is the data in one or multiple tables? If so, again, same answer as
above.
2. Will the user need a printed form, or to just visually scan the screen?
if the latter, use a filter.
3. How many fields are you querying total? If many, you probably need to
create a query that drives a form or report.

Basically, if you are using a few fields in the same table and just want a
subset of it, you can use a filter. If you need to permanently record the
data you retrieve, make a query/report. I think you should use a simple form
to display the data and set up a filter. If you're doing this same thing
repeatedly, set up a query. I've learned the most from the Access help
screens; install everything if you don't have it. Then when you're at a
place where you want to do something, hit F1 and ask the question of the
"expert" or whatever it's called. If your users are inhouse and can learn
the filtering, that is easiest for you.
______________________

Richard Pearce-Moses:

My sense is that you always have a form to work from.  (As a former dBase
geek, this is a pain; I could do all sorts of things from the command
line.)  On the form, you can use an inputbox to prompt for a simple search
based on one value.  The value returned from the input box is then passed
to an SQL query the retrieves a record set from the tables.  That recordset
is then displayed on the form.

If you need a more complex search, you'll need to create a new form with
multiple fields to capture the values for the variables passed to the SQL
query.
________________________

Tom Wildenberg:

In order to do what you want, you have to create a form that's referenced to
a query.  You then use the build function in the criteria section of the
quiry design form to link to the data element that you wish to search for.
To accomplish this you must understand: 1) how to create quiries using a
specified critera 2) how to create forms  3) how to build expression 4) How
to link the form to the quiry.  Ain't it easy?  :-(

Assuming that you've accomplished this, the user CAN ONLY SEARCH FOR THE
FULL ENTRY IN THE DATA column. If the column entry contains "black bears"
the user has to enter every character in the box, otherwise the system will
return a null answer.  Although its very difficult to add free seraching
capability (forgive my ignorance of the correct computer terminology) in a
form view, its very, very easy for an Access user do charater string
searching.  All you have to do is enter the search term in the criteria box
preceeded and followed by an asterisk, e.g., *bears* will return every
record having the character string "bears" in the data element specified.
The quiry will then show every record having that charcter string in the
data column you selected.
____________________________

Terry Abraham:

  The simple answer is Open a New Query, add the tables you wanted to
Query, drag the fields you want to see in the query to the design grid,
and in the criteria line enter, as an example, Like "*" & [Enter Author:]
& "*" Now when you run the query a pop up widow appears and asks you to
"Enter Author". The results will be all those strings that match the
strings entered.

  The middle answer is to hit the Queries tab, click New, and follow the
wizard to create a query. Then in Design view click once on any part and
hit F1 for the the Help screen.

  The long answer would be to buy one of those huge books (I have Access97
Bible by Prague and Irwin) that walks you through the process.



______________________________________
Daniel Sokolow, Archives Coordinator
David Taylor Archives
North Shore-Long Island Jewish Health System
155 Community Drive
Great Neck, NY 11021
mailto:dsokolow@nshs.edu

A posting from the Archives & Archivists LISTSERV List!

To subscribe or unsubscribe, send e-mail to listserv@listserv.muohio.edu
      In body of message:  SUB ARCHIVES firstname lastname
                    *or*:  UNSUB ARCHIVES
To post a message, send e-mail to archives@listserv.muohio.edu

Or to do *anything* (and enjoy doing it!), use the web interface at
     http://listserv.muohio.edu/archives/archives.html

Problems?  Send e-mail to Robert F Schmidt <rschmidt@lib.muohio.edu>