How to make pop-up search box that opens record

D

Derek Godfrey

Hello,

I am having trouble finding an answer on how to do this and I am a newby to
Access, and not well educated on database design.

My question is this: how do I make a small form that is a search box?
Specifically, I want to click on my switchboard "Find a Notice" and it pops
up a search field in which the user types in the person's last name and
displays all last names in the database. At this point the user should be
able to further select by first name. At this point when that name is
selected...I want the correct record to display in the form in read-only
mode. This is my main form with all fields and a photo...the same form
where records are added from the "add a notice" option on the switchboard.

I need some code on how to do this...I think I got the actual form design
part down...I just need this search option.

The overall effect I am after is this: when the database is opened, the user
will have to log-in and then teh switchboard is opened with the options they
have rights to. I will worry about the code for that later on. Let's just
suppose for now that the user has full rights. They open the database and
the switchboard comes up. They have 4 options: View a record (via this
search form), Add a record, Delete (or edit) a record, exit Access. I don't
even want the Access toolbars to show...just the read-only view (after the
search is done) or the empty, add a record view (data-entry).

I hope this all makes sense...but I'm not a programmer and I need to be able
to do this, as the users are not very computer literate...this needs to be
as simple to use as possible.

Thanks,

Derek
 
J

Jeff Boyce

Derek

Rather than use a pop up form, consider putting an unbound combo box in the
header of your "main" form. Base this combo box on the list of names you
mentioned.

In the AfterUpdate event of that combo box, requery the main form, using
something like:

Me.Requery

Base your main form on a query that includes, as a criterion, the value in
the unbound combo box. You can refer to that value with a criterion that
looks like:

Forms!YourMainForm!cboYourNewComboBox

Thus, when your form first opens, there's nothing in the combo box, so the
form displays ... no record!

After you select an item from the combo box, the AfterUpdate event triggers
a requery of the form, displaying the record of the item you selected.
 

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