Select record from query, place record in a form?

H

HedonisticRich

I need to find a user-friendly way to select specific records from a query...
Place these records in a form, then sort the resulting list by selecting a
record and using up/down arrow on the form. There OUGHT to be an Access tool
to do this, but I can't find it, anywhere. For that matter, if some company
has a "toolkit" of "normal" user interface tools or controls, please tell me
where!!! If one does not copy and paste, it appears to take an act of God to
get records from "point A to point B." This makes no sense. I am either way
too bright or way too stupid, and too dumb to know which!
 
D

Damon Heron

More detail please. Do you want a form based on your query that you can
then select individual records from and ?? do what with them? Paste them to
another location? What is the data in the query? Have you designed a query
that only selects those records you want to manipulate?

Damon
 
H

HedonisticRich

Sorry. Simply put, I run a query to select a range of catagories I am
interested in. Then, picking from the list (of many) I want to place the
selected catagory in a form which also contains other previously selected
catagories. Then, I want to sort the second list of values in the form with
the up/down arrow. Certainly, the form represents an underlying table where
all such choices are stored...Thanks for the response!
 
D

Damon Heron

What you describe can be done in several ways, but it is no trivial task, so
some programming skills are needed.
You may want to look at populating a second listbox from selections in a
first listbox to begin. The first listbox would be bound to your query.
The second listbox can then be manipulated either by drag-n-drop or buttons
to move items up/down. Check out
the following to give you some ideas -the Lebans code is for Access 97 but
can be converted.

http://www.lebans.com/vb_listbox.htm

http://support.microsoft.com/default.aspx?scid=kb;en-us;233274

HTH
Damon
 
D

Damon Heron

I found this old example in my library of code. It works for a listbox made
from a value list. These are two cmd buttons -Up and down. My listbox is
called lstSource in this code.

Private Sub cmdMoveDown_Click()
Dim Mystrg As String
Dim Mylng As Long
Dim ct As Integer
ct = lstSource.ListCount
Mylng = lstSource.ListIndex

'an item has been selected from the listbox
If Mylng > -1 Then

'test if it is at the bottom of list
If Mylng < ct - 1 Then

Mystrg = lstSource.ItemData(Mylng)
lstSource.RemoveItem Index:=Mylng
lstSource.AddItem Item:=Mystrg, Index:=Mylng + 1
lstSource.Selected(Mylng + 1) = True
lstSource.SetFocus
End If

End If

End Sub

Private Sub cmdMoveUp_Click()
Dim Mystrg As String
Dim Mylng As Long

Mylng = lstSource.ListIndex
Debug.Print Mylng

'an item has been selected from the listbox

If Mylng > -1 Then

'at the top ?
If Mylng > 0 Then

Mystrg = lstSource.ItemData(Mylng)
Debug.Print Mystrg, Mylng
lstSource.RemoveItem Index:=Mylng
lstSource.AddItem Item:=Mystrg, Index:=Mylng - 1


Debug.Print Mystrg, Mylng - 1
lstSource.Selected(Mylng - 1) = True
lstSource.SetFocus
End If
End If

End Sub

Damon
 
H

HedonisticRich

Thanks so much for the info. Do you have any idea why such goodies are not
either included in Access or readily available on the market?

Thanks, Richard
 
H

HedonisticRich

My GOD! This is a major piece. Thanks so much, Damon. Again, I have no idea
why MS would publish such a nice project, then require programming. I have
done some of this, so this is more of a rhetorical question regarding MS
marketing and selling an "incomplete" product...

Richard
 
Top