Listbox question

G

Guest

I have a unbound listbox on my form that uses qryCaesID that represents all
the records in a a table. I want be able to click a buttom on this form have
it search through the listbox,identify all open records and placed them in
another listbox. I haven't created the other listbox yet.

Currently when an item in the listbox I have, the user selects a caseID
then clicks continue and the edit form comes up. I have decided to us this
listbox so that a cas can be viewed and not necessarily edited if it is
already closed.

I will be adding the requeststatus field to this list box to which tells if
the case is opened or closed or canceled.

Then how do I code to get the open cases from this listbox to another?
 
A

Al Camp

Cyndy,
I think you may be making this a bit more complicated than necessary...

Just create another unbound listbox (or combobox) and using the query
behind it, populate it with only Open cases.
User can select ANY record form listbox1 to edit, or use the 2nd listbox
to edit only OPEN cases.

If you are really set on a button, it would be possible to change the
query against listbox 1, programatically, so that it could either show All
records or only Opens. Create two different SQL statements, one for All and
one for Open, and replace the RowSource using a "Toggle Button".

But, my first suggestion is a much easier way to go.
hth
Al Camp
 
G

Guest

Thanks Al

Al Camp said:
Cyndy,
I think you may be making this a bit more complicated than necessary...

Just create another unbound listbox (or combobox) and using the query
behind it, populate it with only Open cases.
User can select ANY record form listbox1 to edit, or use the 2nd listbox
to edit only OPEN cases.

If you are really set on a button, it would be possible to change the
query against listbox 1, programatically, so that it could either show All
records or only Opens. Create two different SQL statements, one for All and
one for Open, and replace the RowSource using a "Toggle Button".

But, my first suggestion is a much easier way to go.
hth
Al Camp
 

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