Access 2007. Use a list box on one form to open another form and populate it with selected information.

Hi,

I have a list box to select a client.  Then I need it to open another form to display that client's information.

Thanks,

Rick
LVL 1
taborrgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jdc1944Commented:
basically you need to reference the list box in the query that will display the clients name and then add a button on the form to open the other form with the clients info.

for example if your list box is storing a client ID called ClientID, your form is containing the list box is called frmClients.  then in the query that runs the form that shows the client information you can add [forms]![frmClients]![ClientID] to the criteria of the client ID in the query, if that makes any sense.
0
peter57rCommented:
Assuming the listbox is set to allow a single selection only (not mult-select) then you would use the afterupdate event procedure to open your second form.

I'm also assuming that the bound column of the listbox is the id field that identifies the record to be opened.

Docmd.openform "secondformname",,,"ID = " & me.lstboxname
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jdc1944Commented:
Hopefully what you are after is attached in my example database, its a very basic way of doing it.

You can also ignore the button and add an afterupdate event to open the form instead.
Example.mdb
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

taborrgAuthor Commented:
I'm sorry, I couldn't follow that.

I have a table named Clients with ClientID and ClientName

A form with listbox lstSelectClient that looks at the Clients table

Another form with fields for client information.

0
jdc1944Commented:
can you upload your database?
whats the name of the other form that you want to open?
0
taborrgAuthor Commented:
Great!  Work right off.

Thanks!
0
taborrgAuthor Commented:
jdc1944 - thanks for the quick response!  
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.