Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Moving Item Between List Boxes


I have a command button with the Caption ">". When clicked I want the selection the user has made in ListBox1 to be moved to ListBox2.

Anyone ever do something like this before?

thx..




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving A Item In A List Box Up Or Down
I have two buttons on a form and I want the be able to click the up button then move the selected item up or click the down button and have the item go down.

Any Ideas?

Moving Data Between List Boxes
Hi,
I need a little help if anyone has a moment. I have 2 list boxes one called lstSource and the other is lstDestination. I have it set up and working so that I can multi select rows in my source and move them into my value list in my destination list box. I call the function in the click even of a right arrow button. This works great.

Now I want the user to be able to remove fields from the lstDestination in case they make a mistake or change their mind. I want to do this using a left arrow button but I can't quite get the code working properly. I have gotten it to do everything butx but....however, I can't get it to just delete the selected row(s). Here is my code that is working to move my rows from my lstSource to my lstDestination. I assume it must be some variation of this....

<vb code>
Private Sub cmdCopyItem_Click()
CopySelected Me
End Sub

Function CopySelected(frm As Form) As Integer
Dim ctlSource As Control
Dim ctlDest As Control
Dim strItems As String
Dim intCurrentRow As Integer
Set ctlSource = frm!lstSource
Set ctlDest = frm!lstDestination
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
strItems = strItems & ctlSource.Column(0, _
intCurrentRow) & ";"
End If
Next intCurrentRow
' Reset destination control's RowSource property.
ctlDest.RowSource = ""
ctlDest.RowSource = strItems
End Function
</vb code>

Selecting The Nth Item In Several List Boxes
Hi

I was wondering is it possible to select say the fourth item in several list boxes so they are all highlighted in the same place. The coding would be greatly appreciated!

Remove Item From 2 List Boxes
Hi!

I have 2 list box controls with same values - the first list is sorted and the other one is not. I hide/show approprate lists if user wants sorted/unsorted items.

Now I would also like to let the user to delete items from the list - deleting from one list is simple, but how can I delete the same entry in another one (as the list index is not the same)?

I guess it could work by looping thorugh the list and deleting the list entry that has the same text, but is there and easier way?

Bostjan

Parsing Item Between List Boxes
Code:
For n = 0 To List1(0).ListCount - 1
report.List1(0).List(n) = List1(0).List(n)
report.List1(1).List(n) = List1(1).List(n)
report.List1(2).List(n) = List1(2).List(n)
report.List1(3).List(n) = List1(3).List(n)
report.List1(4).List(n) = List1(4).List(n)
report.List1(5).List(n) = List1(5).List(n)
report.List1(6).List(n) = List1(6).List(n)
report.List1(7).List(n) = List1(7).List(n)
Next


what I'm doing in the code is to parse the item in list1 to report.list1
but when the list is having a large number of data/items, the parsing will become slower.
is there any way can cover it?

List Boxes Remove Item
how would you remove an item from a list box?

ComboBox List/add Item, If Item Exists, Dont Add It Again!
Dudes and Dudeesses I need help!

I have a problem with a combobox within a form. I'm scanning down the spreadsheet for values and asking a combobox to .additem, however, the same value may appear twice whilst scanning down. Is there an if statement that will look and check the combobox to see if it is already added, if so dont add it again, if not, add it?

as below,

Code:
combobox.AddItem "Hotmail"
combobox.AddItem "Yahoo"
combobox.AddItem "Hotmail"
Hotmail will be added twice, how can I stop that?

If worst comes to the worst, I can sort it out with a long winded method, but I'm hoping theres a quicker way.

Thanks for all your help

All Things In Form Text Boxes List Boxes...Saving
Is the a command thats save every thing that is changed changed in form ...all text boxes all list boxes ...everything that has changed

Single Item List Box (item Not Really Selecting)
Application=Access2002

The following code has worked for me in the past but won't now for some reason.
I have a private function and/or subs that performs a few simple operations such as setting listbox rowsources and simple math functions on a form. The queries set as rowsource use criteria from other single item listboxes.
Now, for some reason, the queries won't return values until the previously .selected(0) = true (single item) list boxes have been clicked on.
Problem has only been in creating a new form. Perhaps the problem did not occur in older created forms due to compatibility?


Private Sub fraEWTo_AfterUpdate()

[Edited]
    lstRotorHoursPriorTo.RowSource = "qryRotorSwapHoursTotTo" 'gets hoursprior from tblRotors
    lstRotorHoursPriorTo.Selected(0) = True ' This is one place where the problem seems to exist, the control does not function until it has been clicked on via mouse.

    LstClockInTo.RowSource = "qryRotorSwapRAHoursIPTo"
    LstClockInTo.Selected(0) = True

    txtRACHIPTo.Locked = False
    txtRACHIPTo.Value = txtClockHoursTo.Value - lstClockInTo.Value 'nor will this until the lstClockInTo box has been manually selected


A Mechanic in a Programmers shoes
Thanks




Edited by - greenfch on 12/7/2005 11:22:52 AM

Web Control, List Boxes, Text Boxes, Please Help This Is Winding Me Up!
Hi guys i need some help with the webcontrol function in VB6

Part of my program needs to put listbox data from the program into a text box on the web and then click a submit button...

The list box i have has a list of multiple directories in (for the location of my files), from there i just want the program to put the top directory of the list box into a text box on the web and click a submit button on the web (its for uploading a queue of files), then after that has finished uploading, do the next directory in the list box... etc

It sounds pretty simple but i have no idea how to do it...

Thanks for any help you can give me, i will write a really good review about you and good rating etc.

Any knowledge of this would be greatly appreciated

thanks a bunch

toodle pipples

Alex

Moving To The Next Item In A Pivotfield
I have some code which runs in this For loop.


Code:
For Each PivotItem In ActiveSheet.PivotTables("PivotTable1").PivotFields("Questions").PivotItems
Sheets("Pivot Table").Select
Range("A4").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Chart Data").Select
ActiveCell.Select
ActiveSheet.Paste
Sheets("Pivot Table").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Chart Data").Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
ActiveCell.Offset(3, 0).Select

Next

The item "Questions" is in the page field at the top.

I'd like the code to move to the next item in the page field, and perform the code.

Any idea how it's done?

Listview Item Moving
Hi there,

is it possible to move items in a Listview control(Up and down the list) and how, this one is baffling me

the pig...

Moving Item From One Listbox To Another
Hey all

I am trying to move an item from one listbox to another. The first listbox has items where the RowSourceType = "Field List" and the second one is value list. This is my code:

Private Sub DisplayAllFields_DblClick(Cancel As Integer)

If ListOfFieldsSelected.RowSource = (List0.Value & "." & DisplayAllFields.Value) Then
MsgBox ("You cannot select a field more than once. Please select another field")
Else
ListOfFieldsSelected.AddItem (List0.Value & "." & DisplayAllFields.Value)
End If
End Sub

When I double click the same value in the first list again, it brings up the msgbox once but it doesn't do that once it has added another field to ListOfFieldsSelected. I would use the RemoveItem method so user can't click the field again but DisplayAllFields is set to Field List so it can't remove item unless set to "Value list". Any suggestions on this?

Any help will be greatly appreciated.

Many thanks

Rupa

ListBox, Moving From First Item To Second And So On
Hey, im working on a media player, the media player works great but the playlist is screwey! Im having troubble with this:

You select an item for play - 100% ok
it plays it - 100% ok
it then goes to the next item on the list - BUGGY!

it wont move to the next item and when it does, it wont update the selected item eg, it will play the next item then when thats done it will play the one before that not the next on (constant loop between two files). Please help

Combo And List Boxes To Text Boxes?
Connecting sub-menus to rich text boxes is fine is most cases but the user does not always want to use menus to load and display text. Applying the same technique as sub menus to text boxes with combo or list boxes just wont work could someone please help me out with this one.

Both combo and list boxes will for example:

Contain an alphabetic list.
When the user clicks on a file it should locate the text file from the drive.
It should then open it into a rich text box on the same form.

Could this be possible?

Please any help will greatly be appreciated.

Help With File List , Dir List And Drive List Boxes..
How do i link my drive list , file list and dir list boxes to gether , so that when i for exaple set the drive list to c: , the dir list will then give all dir in there, and file list will show me files from the directory, right now the default file list is set to my vb file list and i cant change it...

Finding List Item As U Typed In Combo Box(Dropdown List Style).
Basically the title say it all.

When I type a letter in combo box it finds item by matching the letter that I typed, but when I type in a second letter it searchs item that starts with the second letter.

I wonder is there a way to macthing list item as u typed in combo box(Dropdown List style).

Thanks in advance.
Joon

Create List Of Files From Folder But Allow Double Click On List Item To Run Bat
I am a newbie
But am making some progress
My next plan is to make a simple dialog with a list box and 3 buttons to do the following
List all the batch files in a folder
then allow me to highlight one item in the list so when I click the button it will run that bat file.

Sounds easy enough but I just keep hitting a brick wall and am not making any progress at all.

All help or similar snipits of code that I can re-organise will be greatfully apperciated.

Thanks in advance

HighLight List Box Selected List Item With User Defined Color
Hi Friends,

I need a help from u all. My problem is to change the Backcolor of the selected listitem of a listbox.

Let me explain detail. Normally in a listbox if we selected the list, the list item will be highlited with blue backgroud (ie. the selected item color settings of the system). Now I need to hightlight the selected list in the list box with my own color say red, green or something else.

Would anyone help me.

V.P. Vijayavel

Moving The Selected Item In Listview
****
I solved the problem, thanks to all for your attempt at helping.

Here is the code:

Set ListView.SelectedItem = ListView.ListItems(i)
****

I have a Listview populating from a database and sorts the data alphabetically.

Now when the user deletes an item from the database, it also refreshes the listview.

The question I have is, the listview always sets focus to the last item it added, however it does not add them alphabetically, so after there added and the listveiw sorts them, the item selected could be anywhere!? How can I have this list view set focus to the first entry? Or better yet one that I specify or has been saved (IE save the record ID when they exit the prog, so when they come back I can pull that and set focus to that item)??

Thanks for the help.
Bryan

[This message has been edited by Bryan (edited 01-12-2000).]

How To Change Back Color Of List Item In List View
Dear members,

i am having small problem with listview control , I want to assing alternate colors to list items, but i con't,

hope someone will help

regards
D.L.Narayana

Moving Dialog Boxes
Hi,
Is there any method to set the locations of the Dialog boxex ?

We can give the location of the "Windows", "Forms" by using Move or MoveWindow(API) methods. Like that can we locate the "Dialog" boxs...?
I think this can do bcos Microsoft applications has this kind of Dialog boxes and they are showing in correct locations of the screen

How can i do this...? Pls help me find out

Moving Picture Boxes
I am making a soccer shoot-out game and i want to move the soccerball (the Picture Box) to where the player selects eg. top right, top left, top centre, bottom right, bottom left, bottom centre. If someone could please help me with this code it would be much appreciated

Moving Text Boxes
Hiii,
I need to move a text box to the mouse point. How can I move. How can I get the mouse location.

Thanks
Sam

Moving Boxes With Loops
Private Sub cmdleft_Click()
Loop
frmloop.Left = frmloop - 1
Do Until frmloop.Left = 2
End Sub

Private Sub cmdright_Click()
frmloop.Left = frmloop + 1
End Sub

Private Sub cmdup_Click()
frmloop.Top = frmloop - 1
End Sub

Private Sub Cmddown_Click()
frmloop.Top = frmloop - 1
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

It keeps saying I have a loop without a do in the first cmd. THE DO is there. Why doesn't it like me.

Moving Picture Boxes
Does anybody know how to move a picture boxe across the screen within a visual basic form.

List Box Item Scrolling (Next Item)
Hello,

I was wondering what the code would be for a command button to make the next item in the list box be selected?

Kind of like a NEXT button.
EXAMPLE:
List box Line 1
List box Line 2
List box Line 3
List box Line 4

If List box Line 2 is selected then clicking the next button would DESELECT List box Line 2 and SELECT List box Line 3.

If I didn't explain enough just let me know.

Stilekid007

ListBox - Move List Item To Place In List
I have a list box with several items. I am trying to make a button that when the user selects an item in the list box, they can click on the button which will move the item up one in the list box:

So if my list looked like this:

ONE
TWO
THREE
FOUR
FIVE

and the user selected FOUR and clicked the button the list would look like this:

ONE
TWO
FOUR
THREE
FIVE


Does anyone know how to do this?

Thanks,
M

Combine List Items To Create New Item In Same List?
Hi all,

This has been giving me fits for a few days - any help would be most appreciated. I'm sure it's pretty simple, but I'm new to VB (and programming in general) and can't seem to come up with the correct syntax to get this to work:

I have a listbox from which the user can select mutliple items. Once user performs a multi-select, I enable a button (no problem there). When user clicks that button, I want to create a new item in that same list consisting of all selected items with "AND" between them.

Thus, if user had selected <item 1>, <item 2>, and <item 4>, the new item would be "<item 1> AND <item 2> AND <item 4>". Can someone please help me with the logic and syntax on this?

Here's what I have up to this point (I've removed the parts that I believe - based on the fact that this is not working - to be wrong and replaced them with ?????):

Code:
        Dim terms As String
        For Each terms In List.SelectedItems
            If List.SelectedItems.Count > 1 Then
                terms = ??????? & " AND " & ???????
            End If
        Next
        List.Items.Add (???????)


Thanks!!



Edited by - troy_atl on 10/17/2005 12:04:26 PM

Change Background /Forgroound Of Each List Item In A List Box
How would i be able to change the back color of a listitem in a list control ? For example i want item number 1 to have a red background item number 2 to have a blue background etc.
Thanks for the help

Jerry

Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!

thanks!

When Moving Item Down In The Listbox The Text Disappears
Okay dont know why but the text is dissapearing when an item is moved down the list box.

Image1 displays before the move down
Image2 displays after the move down
Code is also attached. I am very confused I have been through this code througherly and I am sure there is not an error in the code.




Code:
' check: only proceed if there is a selected item
' check: last item can't be moved down
' save items text and items indexvalue
' remove item
' place item back on new position
' if you keep that item selected
' you can keep moving it by pressing cmdDown
' for arLoopCount adds the new playlist entrys from
' lstPlayList.
' list1 refreshes
' lstPlayList refreshes
Dim tempStr As String
Dim iIndex As Integer
Dim arLoopCount As Integer
List1.Clear ' Debugging orriented object to display the contents of arFilePlayList Array
If lstPlayList.SelCount = 1 Then
If lstPlayList.ListCount - 1 = lstPlayList.ListIndex Then
Exit Sub
Else
tempStr = lstPlayList.List(List1.ListIndex)
iIndex = lstPlayList.ListIndex
lstPlayList.RemoveItem lstPlayList.ListIndex
lstPlayList.AddItem tempStr, iIndex + 1
lstPlayList.Selected(iIndex + 1) = True
End If
End If
For arLoopCount = 0 To lstPlayList.ListCount
arFilePlayList(arLoopCount) = lstPlayList.List(arLoopCount)
List1.AddItem arFilePlayList(arLoopCount)
Next arLoopCount
List1.Refresh
lstPlayList.Refresh

Simple! Moving A Listbox Item For One Lsitbox To Another.
How can I move an item from

lstbox 1 ---> lstbox 2

I want the item to be removed from lstbox 1 and added to lstbox 2

Thanks for anyone who helps.

LIST BOX HELL. Please Save, Remove Items, Many List Boxes...one Last Name
ok, so the code so far, or as much as you need to see, is
****************************
***************************
***************************
***************************
***************************

Sub LoadCal()
Dim gdtDate As Date
Dim i As Integer
Dim x As Integer
Dim startDay As Integer
Dim giMaxDays As Integer

' clear list boxes before filling again
For i = 0 To 41
List1(i).Clear
Next

' * * * * * * * * * * * * * * * * * * * * * *
' * * * * * ADD DAY NUMBERS * * * * *
'label at top of form
Label1.Caption = MonthName(giMonth) & " " & giYear

'this is the current date
gdtDate = CDate(giMonth & "/01/" & giYear)

'minus one so the first line is never completely empty
startDay = Weekday(gdtDate) - 1

'the number of days in this month
giMaxDays = Day(DateAdd("m", 1, gdtDate) - 1)

'populates list boxes with days
x = 1
i = startDay
While i < (giMaxDays + startDay)
List1(i).AddItem (x)
x = x + 1
i = i + 1
Wend

' * * * * * * * * * * * * * * * * * * * * * *
' * * * * * ADD NAMES TO DAYS * * * * *

' !!!!!!!!!!!!!!!!!check to see that list is not empty !!!!!!!!!!!
If lstAgentList.ListCount = 0 Then GoTo done
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

'agent list counter, "at which item" index
x = -1
'populate list boxes from the first day of the month with numbers
i = startDay
'counter for number of days until sunday
a = startDay - 1

'from the first day to the last day
While i < (giMaxDays + startDay)
If a < 6 Then
'a maximum of 3 names per day
While (List1(i).ListCount) < 4
' if there are no more items in the items list ('x' is greater than counter)
If x < (lstAgentList.ListCount - 1) Then
x = x + 1
' otherwise set it back to 0 (zero)
Else
x = 0
End If
'add the next name from the established agent list
List1(i).AddItem (lstAgentList.List(x))
Wend
a = a + 1
Else
'a maximum of 3 names per day
While (List1(i).ListCount) < 4
'add the next name from the established agent list
List1(i).AddItem (lstAgentList.List(x))
'here we do not increment name for it is a sunday
Wend
'reset 7 days until sunday counter
a = 0
End If
'increment day count
i = i + 1
Wend

done:
' end
End Sub



***************************
***************************
***************************
***************************
now see the shaddy thing with this is...well, it's a calendar month see, and every day is a list box....first item, the date, 1st, 2nd, 3rd, 4th, and so on...each list box can hold that first item, the date, plus 3 names.

if someone double clicks on one of those names (which are populated through other methods...not important) i want that name to be deleted...now where i am out of ideas is: how do i delete one item from one list when my list (List1) is an array of about 41 list boxes all named List1 (x) see....

also if I wanted that name which was double click to delete itself through the entire month, then ....well...the rest is my own trouble...but so far i can't seem to be able to delete.

grrr.
...

thanks in advance,
-munchkin

Moving Multiple Picture Boxes - Lag?
On my form I have a control array of 239 picture boxes NOT being moved. Then I create 5 picture boxes of a new control array and move them with a timer with the interval set to 10. It moves fine, but when I load another 5 picture boxes totaling 10 the game starts to lag by the images starting to move slower then set to. The more I load and more the slower it keeps getting.

I am increasing the .top of all of the picture boxes by 25 every time the timer ticks with a 10 interval.

How can I prevent this 'lag'?

Problem Moving Between Text Boxes
Hi all,

I have a Form with two text boxes. All the controls have the VB assigned default names. Basically I want the user to enter the data before he leaves the text box to the next one, by pressing tab or using the mouse. So I tried using the following code ..

Private Sub Text1_LostFocus()
If (Text1.Text = "") Then
MsgBox ("TextBox 1 is empty please reenter ")
End If
Text1.SetFocus
End Sub

Private Sub Text2_LostFocus()
If (Text2.Text = "") Then
MsgBox ("TextBox 2 is empty please reenter ")
End If
Text2.SetFocus
End Sub

The problem is that if I move from Textbox1 to Textbox2 by pressing Tab, I get the Msgbox saying "Text Box1 is Emtpy" , but when I click Ok, the control returns back to Text1, but in the process it triggers the lost focus event of Text2 so I get the message "Text box 2 empty" and this messages cycle on for ever, and I end up killing my application. Can anyone suggest a way to avoid this problem ?

Thank You

Senthil

Problem Moving Between Text Boxes
Hi all,

I have a Form with two text boxes. All the controls have the VB assigned default names. Basically I want the user to enter the data before he leaves the text box to the next one, by pressing tab or using the mouse. So I tried using the following code ..
Code:
Private Sub Text1_LostFocus()
    If (Text1.Text = "") Then
        MsgBox ("TextBox 1 is empty please reenter ")
    End If
    Text1.SetFocus
End Sub

Private Sub Text2_LostFocus()
    If (Text2.Text = "") Then
        MsgBox ("TextBox 2 is empty please reenter ")
    End If
    Text2.SetFocus
End Sub

The problem is that if I move from Textbox1 to Textbox2 by pressing Tab, I get the Msgbox saying "Text Box1 is Emtpy" , but when I click Ok, the control returns back to Text1, but in the process it triggers the lost focus event of Text2 so I get the message "Text box 2 empty" and this messages cycle on for ever, and I end up killing my application. Can anyone suggest a way to avoid this problem ?

Thank You

Senthil



Edited by - IDontKnow on 8/10/2004 9:31:36 PM

Moving Picture Boxes W/ Keyboard
is there a way to be able to move picture boxes using the keyboad? i.e picturebox1 moves up using the caps lock key, and down by using the shift key. picturbox2 moves up using the plus sign(the one all the way to the right of the keyboard no the one above the equal sign) and moves down by hitting the enter key(under the plus sign).thnx in advance for any help.

Questions: BitBit Moving, Walkmasks And Item Pickups.
Ok, so far have i quickly created a small program where a picture(the guy you control) moves instantly to the location of your click. Theres 3 things i must now:
1. How can i make my guy move slowly to the targeted location? not instantly.

2.How can i create walkmasks? Forexample if i create a tree, and i dont want my guy to walk right through the tree but around it.

3.How can i make my character pick up items? Forexample how can i make my guy get 10 score-points when he moves over an item, which in reality is a picture.

Edit*
I use BitBit.
This is not going to be a real game, iam just testing things out before i start creating a game.
Nothing is animated.

Moving Arround A Control Array Of Txt Boxes
hi could any body tell me how i can use the arrow keys to move between txtboxes in a control array i have 41 txtboxes in the form of 7 columns by 6 rows.

the code i came up with as an idea was:

Code:
Dim iLoc As Integer
txtPuz(Index) = iLoc
If KeyCode = vbKeyUp Then
If iLoc > 6 Then
iLoc = iLoc - 7
txtPuz(iLoc).SetFocus
End If
End If

If KeyCode = vbKeyDown Then
If iLoc < 35 Then
iLoc = iLoc + 7
txtPuz(iLoc).SetFocus
End If
End If

It didnt work properly when set to the forms keydown event. so what code would be best and where would i put the code?

Thanks

Combo Boxes Or List Boxes?????
A bit of a beginners question. Hope it makes sense

I dont know which is the best to use. Here is the problem:

I want some kind of drop down list that allows the user to pick one of 12 items. Then that item is linked to a set of numbers. For e.g. if user chooses the item "A" then this means the numbers 0.025689 and 0.85696 is linked to each. Now do i use a combo or a list item or something else.

In addition what kind of code do you use to enter new items in a combo box or list item box. I tried to use:

ComboBox1.AddItem "A"
ComboBox1.AddItem "B"

within the combo box private sub - but when i play it back the combo box is empty. Any ideas???

Thanks

List Boxes And Text Boxes
Ok i have a list box that has a list of movies to choose from then you choose how many tickets you want i want to know how to display them in a text box and how to clear the dat file that i saved it in

List Boxes And Text Boxes
I have a list box with a bunch of items in it. I'm trying to make it so that when you click on an item in a list, the text appears in a text box. I don't know too much.. but what I have so far is

Private Sub List1_Click()
Dim i As Integer
Text1.Text = List1.List(i)
End Sub

What this does is when I click an item, it makes the text of the textbox the first item in the list. How do I change it so that I can pick an item from the list and have the text of that item displayed in the text box? Thanks in advance!

List Boxes Vs Check Boxes
How much harder are List boxes to program compared to Check boxes?

List Boxes = Text Boxes
Hi I'm new here (and to VB). I'm using VB in Excel and trying to get a list box to write to a series of three text boxes. I have a mobile phone user form and the list box has a selection of phones in it. I want the user to be able to choose three phones from the same list box and have the results display - one in each box. Can I do this and, if so, how?

DataList Boxes Vs. List Boxes
OK - I currently have a DataList box which displays all of my records using the "List Field" Property. I need to enable a multiselect feature though. So I decided to use the REGULAR List Box, since it has a multiselect property. Yet, I cant seem to get the list box to have all of the records in there (or any of them for that matter). Is there a similar property in regular list boxes like the "List Field" Property, or is there a similar property in DataList Boxes which can enable multiselect?

Someone help!

Add A List Item To A Loaded Form List
help please. this is probably very simple.

i have a form loaded and showing. i need to add items to a list box, and my code is in a public sub in a different module.

my code follows. i wind up getting an "object doesn't support this type of property..."

i feel like i am close, i just don't seem to be referencing the form list correctly.

thanks much!

Public Sub BuildOverviewList()

Dim dbSOURCE As Database
Dim dbTARGET As Database
Dim rsSOURCE As Recordset
Dim rsTARGET As Recordset
Dim strDatabase As String
Dim strTable As String

strDatabaseName = "ProductCategories.mdb"
strTableName = "tblCurrentPresentation"
Set dbTARGET = OpenDatabase(dbPath & strDatabaseName)
Set rsTARGET = dbTARGET.OpenRecordset(strTableName, dbOpenDynaset)

'aryProductGroup provides the selected categories
For i = 1 To UBound(aryProductGroup)
'aryCategory1
For j = 1 To UBound(aryCategory1)
If aryCategory1(j) = -1 Then
strDatabaseName = "Category1_information.mdb"
strTableName = "CategorySlides"
Set dbSOURCE = OpenDatabase(dbPath & strDatabaseName)
Set rsSOURCE = dbSOURCE.OpenRecordset(strTableName, dbOpenSnapshot)
'write the record to the target table and add to list1
'USE THE ARRAY POSITION (j) TO GET THE SLIDE NAME FROM THE CORRECT TABLE
'ADD THAT SLIDE NAME TO THE LIST.
With rsSOURCE
rsSOURCE.Move (j)
With rsTARGET
.AddNew
![StepID] = 4
![CategoryID] = aryProductGroup(i)
![ProductID] = j
![Name] = rsSOURCE.Fields("SlideName").Value
.Update
End With
'Forms.frmPresOview6.List1.AddItem rsSOURCE.Fields("SlideName").Value
Forms.frmPresOview6.List1.AddItem rsSOURCE.Fields("SlideName").Value
End With
'also add record to ProductCategories/tblCurrentPresentation
End If
Next j

Next i

Combo Boxes Next Item
THANK TO ALL !!
my application has a combobox simple with N items

How to move to next item and show on combo with vb 6 code?

CMBX.ADDITEM = "EXAMPLE"
CMBX.ADDITEM = "EXAMPL1"
CMBX.ADDITEM = "EXAMPL2"

EVERY TIME THE USER PRESS A COMMAND THE COMBO CHANGE TO NEXT ITEM ON LIST
THANKS

Copyright © 2005-08 www.BigResource.com, All rights reserved