Creating search form to return results in report

D

Donald

I am creating a mail parcel database that contains information such as first
name, last name, apt # and our unique mail parcel code that we put onto
parcels when they come into our office, for our resident parcel mail. I am
at the point in the development of this database where I need to search the
records in the database with those criteria. I would like to create a search
from that has several textboxs where the user can enter either the first/last
name in one textbox, apt. # in another textbox or our mail code in another.
Each textbox will have a search button next to it. Depending on which search
button is pressed (eg. first/last name, apt. # of mail parcel code), I would
like for the search to display the results (each record found) in a report
for viewing. I'm fairly competent with access, but when it comes to VBA
coding, I need a lot of help. Any guidance or assistance would be greatly
apprecitated. Thanks in advanced.

P.S.
I have pretty good programming background (C, C++, Assembly and Basic) so
you don't have to worry about breaking down the commands or syntax too much.
 
A

Allen Browne

See:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html
The sample database in the article shows the search results in the form, but
the code is identical to build the WhereCondition for OpenReport.

If you just want to search on one field at a time, see:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html
This one consists of a combo where you choose which field to search, and a
text box where you type the value to find. To use it on any form, you just
copy the combo and text box, and set one property.
 
D

Donald

I appreciate the reference to your tutorial Allen. It has helped me out a
lot, but I'm still having a problem. I have copied the module and combo
boxes to my form, but when I open the form, the combo boxes don't appear. I
read your troubleshooting sections, but it didn't resolve the problem. I
know my form is bounded to my database and the combo boxes are unbounded too.
It's been frustrating trying to find out what might be wrong. Do you have
any suggestions that I should try?
 
A

Allen Browne

Open the form in design view.
Open the Properties box (View menu.)
What is the RecordSource property of your form?
Is it the name of a table, a query, or a SQL statement?

Examine the properites of the combo and the text box you copied to your
form. The Control Source property must be blank for both of them.

If both those things check out, tell us about the bound controls on your
form. Are they check boxes? combos? text boxes? How many? Bound to what type
of fields?
 
D

Donald

I have the following bound controls on my form: 10 Labels, 9 Textboxes and 1
checkbox. The textboxes are bound to the fields in my table.
 
A

Allen Browne

That's not a specific enough reply to determine what the expressions ought
to be.

I'm not sure I can contribute further to this thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top