List Box / Forms

M

Michelle T

Hi:

I haven't used Access for 2 years so I'm very rusty and
need some assistance.

I'm creating a Contact database and what we would like to
do is the following:

In the switchboard, have a button set up for each letter
of the alphabet. When the user clicks on the letter, a
query will come up that shows all the users that match
that letter. This works fine.

Now I'm trying to create a list box using this query and
when the user clicks on the client, I want another Form I
created to open and show the client's information. I'm
very confused about the VBA codes needed for this to
happen.

Any help would be great!

Thanks,
Michelle
 
D

Dan Artuso

Hi Michelle,
What you do is first create a form that displays all client's info.
You should have something like a ClientId field in the query.

Now, your listbox should contain the ClientId as well, this should be the 1st column
and the bound column as well. I assume you have the name showing in another column in the listbox.

So now in the click (or DoubleClick) event of the listbox you can simply put:

DoCmd.OpenForm "yourFormName",,,"ClientId = " & Me.yourListbox

Substitute the correct names of course!
If I didn't exlplain that well enough, post back.

HTH
Dan Artuso, MVP
 

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