List Box to show your Order

B

Bob Vance

At the Moment I have a query that lists my Horses on my form I have a Text
box next to each horse so depending what number I put in my text Box gives
me a Printing Order, This is for Printing Worksheets, What I am trying to
Achieve is say to list Boxes and you highlight a Horse a click the arrow to
send it to another Listbox on the same form then print the Order in list
Box2, Once you select a record and click it to List Box 2 it disappears from
list box 1, Any Ideas how to start this?
 
J

Jeff Boyce

Bob

That sounds a bit like a description of how the, say, query wizard works!
Pick one from box A, send to box B (and vice versa)...

One way to do this is to have a query that gets all "available" objects
(horses in your situation) and lists them in the left-hand listbox. By
available, I mean all of the possible choice, with the 'already - selected'
taken out.

Now create a second list box that shows all the "selected" objects -- use a
query to see these. NOTE: this will require that you create a new table to
hold the "selected" ones, and query that new table.

Now add some command buttons that:

* check to see if an object has been selected
* if it has, "move" it by doing whatever's needed... for example, if you
pick a "selected" one, and move it to "available", what you are really doing
behind the scenes is deleting the selected one from that table and
requerying to find available ones.

Does that make sense?


Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
B

Bob Vance

Thanks Jeff I have created a New Form that has a new Table as its Record
Source, ListBoxA is queried to a list of all my horses (HoreseName)text ,
ListBoxB has the New Table as its Record Source, Now I will try to code
ListBoxA to send and Delete to ListBoxB and Vise Versa
Am I on thr right track.........Regards Bob
 
J

Jeff Boyce

Bob

The one wrinkle you'll want to add in is that you do NOT need to see all
your horses in listboxA, but only those that aren't already stored in the
"selected horses" table.

Other than that, sounds like a good start!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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