How do I toggle between form and list selection

  • Thread starter Thread starter jer99 via AccessMonster.com
  • Start date Start date
J

jer99 via AccessMonster.com

I have a form of clients with their information.
I have created another form that lists the clients, but I can't figure out
how to click on one of the clients in the list and have that form close,
return to the client main form with the selected client.

Seems to me that this would be a common item. Click a button to get a list of
clients, have the ability to sort by ID or name and then click on a client to
"send" it to the original form.

Anyone have ideas?
 
I have a form of clients with their information.
I have created another form that lists the clients, but I can't figure out
how to click on one of the clients in the list and have that form close,
return to the client main form with the selected client.

Seems to me that this would be a common item. Click a button to get a list of
clients, have the ability to sort by ID or name and then click on a client to
"send" it to the original form.

Anyone have ideas?

By far the simplest way to do this is to just use one form, with an
unbound Combo Box based on a query sorting the client names
alphabetically. The toolbox wizard will set up a combo to do this if
you choose the option "Use this combo to find a record".

You can do it with two forms, if you want, but it would be less
efficient and would require more VBA code.

John W. Vinson[MVP]
 
The reason I didnt use an unbound combo was because I wanted the ability to
sort by ID or name on the fly.
At first, I thought that using a list view and a form view would be the
answer, but I couldn't figure a way to do that.
I may have to go back to the combo.
Sure wish there was another way.

John said:
I have a form of clients with their information.
I have created another form that lists the clients, but I can't figure out
[quoted text clipped - 6 lines]
Anyone have ideas?

By far the simplest way to do this is to just use one form, with an
unbound Combo Box based on a query sorting the client names
alphabetically. The toolbox wizard will set up a combo to do this if
you choose the option "Use this combo to find a record".

You can do it with two forms, if you want, but it would be less
efficient and would require more VBA code.

John W. Vinson[MVP]
 
The reason I didnt use an unbound combo was because I wanted the ability to
sort by ID or name on the fly.

You can, though; for instance you could have an Option Group control
with two buttons labeled Sort By ID, Sort By City, with values 1 and
2. In its AfterUpdate event you could change the RowSource property of
the combo to a query sorted appropriately.

John W. Vinson[MVP]
 
good idea.
For the sake of time, that's where I'll head.
I appreciate the help.

Its just that I have this picture in my head and cant seem to figure out how
to do it. It's too bad that Access doesn't allow me to create code behind a
button that would allow the form to switch views (form vs list).

Jerry
 
It's too bad that Access doesn't allow me to create code behind a
button that would allow the form to switch views (form vs list).

It does. You can change the Default View property of a form in VBA
code. The disadvantage is that you must open the form in design view
to do so.

John W. Vinson[MVP]
 
Back
Top