Forms :: Move Selected Between Two Listboxes?
Dec 16, 2013
Move Selected Items Between Listbox1 (listEmp) and listbox2 (listAllocated). the items moved from listEmp must be removed from listEmp when moved to list allocated and vice versa.
Overview:
listEmp is my first listbox and currently has the query in it's rowsource
SELECT e.* FROM qryEmp AS e;
it has 7 columns but only 6 are showing (Column 1 is hidden)
and it is currently bound to 1
listAllocated has only 4 columns (can be changed) i only need the first 4 columns from the first list.
currently it has no row source and the row source type is set to Value
it is also bound to 1
I did find some code that does not do what I need but is closer than anything that I have found so far. It seems like it is copying the Selected Items from Column 1 and pasting it in the second listbox. but it is pasting them all in a row and not in individual columns below is the code. I will post a screen shot in 2 posts time.
Code:
Private Sub cmdCopyItem_Click()
CopySelected Me
End Sub
[Code].....
View Replies
ADVERTISEMENT
Dec 11, 2013
I have 2 Listboxes the first list is based on a query I need to select items from this box or part of each item and move to another listbox. the items in the second listbox will be used in a report. I have previously posted on another forum with no real luck fyi. the query is put straight in the RowSource.
View 3 Replies
View Related
Feb 10, 2014
I've designed access form with one listbox and added 'up' and 'down' buttons to move up and down the selected item in the listbox. i.e from its selected position to one item up when 'up' button clicked and same as one item down when down button is clicked. Any VBA code will do this functionality?
View 7 Replies
View Related
Mar 24, 2006
hi
i apologize if this question has been answered before. i have looked at numerous others in the 'listbox' search box, but not had any success in adapting the answers to what i need.
i have a form A with a listbox of 1,400 rows
i then select maybe the 10th row down on the listbox, and
a new form B opens with information pertaining to the listbox row selected
form A changes its visible value from true to false
i do my editing on form B
now what i would like to do is, on form B click a next button and for
form B to close
form A to be visible again, and the next row (11th) on the list box be highlighted
form B to open again but with pertaining to the next listbox row (11th) selected
form A to not be visible
any help would be very much appreciated
View 1 Replies
View Related
Aug 20, 2014
I am new to Access and I have get to where the users can make selections in the listboxes, but then I need to save the selection in a query or table to save thier changes.
View 1 Replies
View Related
Dec 2, 2013
What i wish to do: list activities in a continuous form, and in one column display for each row a listbox which rowsource query is based on another column value from the same row.
I have to admit that the best thing for me would be to be able to create through vba a continuous form... is that possible?
View 3 Replies
View Related
Apr 26, 2014
I have an Equipment Form with a Supplier subform. The Supplier subform also has a subform, Equipment Pricing Records.
I have the ability to change the Supplier via a combo box, but Equipment Pricing Records become orphaned.
What I would like to do is when a Supplier is about to be changed, for the user to have the option to either a) delete the sub records, or b) the sub records to move across to the new Supplier.
I know I will need to use the after update event once the delete or move decision is made, but I can�t think how to identify the records and then either delete or move them to the new Supplier ID.
The EquipmentID will never change.
Fields are;
EQUIPMENT form;
EquipmentID
SUPPLIER form;
SupplierID
EquipmentIDFK
PRICING RECORD form;
PricingRecordID
SupplierIDFK
EquipmentIDFK
View 14 Replies
View Related
Mar 20, 2014
move a form without borders but not for microsoft access it's for visual basic microsoft access 2013
View 3 Replies
View Related
Jun 23, 2013
I have a subform that I use to scan in products using a barcode reader, when the item scans it moves to the quantity (Qty) field where I have this code:
Code:
Private Sub Qty_GotFocus()
Qty.Value = 1
DoCmd.GoToRecord , , acNewRec
txtOrderNo.SetFocus
End Sub
I am simply trying to set the Qty value to 1 and move onto the next record ready to scan another product in.
View 10 Replies
View Related
Feb 7, 2014
I have a form containing these fields
trantype,Damount, Camount,Description
And trantype look-up field containing transaction type debit or credit.
Here in this form i want when i select debit transaction type then control move to the Damount and on pressing Enter key Camount skip and control move on Description, and same like this when i choose transaction type Credit then Damount skip away and control move on Camount field and next to description, and access doesn't ask for enter value in Damount.
View 4 Replies
View Related
Dec 21, 2014
I have a main form that has 2 sub forms on it - one below the other.
Because I did not like this layout I created a tabbed form on the bottom of the main form (2 tabs) and would now like to move each sub form onto each of the tabbed forms.
View 1 Replies
View Related
Jul 12, 2013
I have a form with a combox control that is bound to a table. It is a status field. When the status changes, I would like to take the OldValue of both the status combobox and the status date and move them to a table that when accessed will show a history of the prior status and corresponding dates.
View 14 Replies
View Related
May 30, 2014
Is it possible to set a property to allow the user to click and drag an open form out of the Microsoft Access 2010 parent window? Specifically to a second monitor.
View 3 Replies
View Related
May 21, 2014
I have a list box contains 10 times . I have UP and Down buttons to move item up and down. My VBA works only if i set listbox multiselect property to 'None'. For the multiselect=simple option it throws error like in valid use of null in this line of code :
sText = lbfNames.Column(0, iIndex)
My VBA
Code:
Private Sub cmdUP_Click()
Dim sText As String
Dim iIndex As Integer
iIndex = lbfNames.ListIndex
'check: only proceed if there is a selected item
[Code] ....
View 8 Replies
View Related
Jul 13, 2013
I have a form with a listbox in which users should be able to move the items up and down. The listbox has 4 columns and multiple selection is enabled.
For a NON multiselect box I have it working, and also for a multiple selection box but in that case it works only for one row at a time.
For a NON multiselect listbox:
Code:
cmdDown_Click()
Dim i As Integer
Dim t1 As String, t2 As String, t3 As String, t4 As String
i = selectie.ListIndex
t1 = Nz(selectie.Column(0, i))
t2 = Nz(selectie.Column(1, i))
[Code] ....
You can select an item and then press "Down" as many times as you want to put the items as "down" in the list as you want it to be.
Multiselect listbox
This code also works for a multipleselection listbox when one item is selected, however, after you press "down" the item is still selected (highlighted) as the code reselects is (last line) BUT the value of selectie.listindex apparently is set to "-1".
Pressing "Down" again generates an error (i = -1). I can evade the error by adding "if selectie.listindex <=0 then exit sub", but that doens't fix the problem that the only way I can manage to reset the listindex to the new "position" of the item is to click on it again and THEN press "Down".
To fix this and be able to press "down" multiple times listindex should be set to the new value.
Adding a "me.selectie.listindex = i -1" doens't work (error), it seems like this value is readonly.
I can't find a way to "simulate" a mousepressed selection and really set the listindex.
The other problem is of course that this code doens't support moving multiple items at once: listindex points to the last selected item, but only one.
So, I tried another piece of code to move multiple items, not using listindex (since that resets to -1), but I run into another problem
Code:
Private Sub cmdDown_Click()
Dim var As Variant
Dim i As Integer
Dim n As Integer
Dim t1 As String, t2 As String, t3 As String, t4 As String
n = Me.selectie.ItemsSelected.Count
[Code] ....
The problem with this is: I can select multiple items and press "Down", but the problem now is that the selection is lost as soon as the code removes the first item, and the 2nd loop skips the if selected(i) = true (nothing is selected anymore).
The me.selectie.selected(i+1) = true doens't work since that would only reselect the first item after moving it.
The code "forgets" which items were selected and moves only one item...So I guess I need to put the indexnumbers in memory while moving the items.
I have been searching a lot, but can only find VB-solutions. In VB it's a lot simpeler using f.e. the .list property of a listbox, which is not available in MSAccess
The solution I'm thinking about is:
- set an array with the numbers of selected items
- put indexnumbers of the selected items in the array (f.e. 3 and 4)
- move items based on the indexnumers in the array
- when moving an item update the indexnumber in the array (3>4, 4>5)
- after moving all items reset the selection based on the array
It occurred to me then if I'm going to use an array anyway, I might as well load all items in an array, do the "resorting" and the reload the items in the list from the array. Might be more straightforward?
Btw...It seems VB has a simple solution to moving items: listbox.list(i) = listbox.list(i+1) or something like that moves an item. Even Excel seems to have this property but not MS Access!
View 1 Replies
View Related
Apr 13, 2013
I have a form with a subform in it. The subform is actually going to actually have more information and is going to take up the majority of the form. The reason why it's the subform instead of the main form is because of the nature of the parent/child relationship.
Layout-wise I'd like to have the content of the main form in the top left, with the subform taking up the space from the top right down to the bottom. This ends up covering the content of the main form in the top left. I tried using the Send to Back function on the subform but it still blocks the main form.If there's no easy way then I guess I'll just have to have the entirety of the subform below the main form content.
View 2 Replies
View Related
Sep 6, 2014
I would like to have a Button "Files to FTP", So, the Macro should move the files from the Local Files from the Directory to the FTP Location.
View 6 Replies
View Related
Jun 28, 2013
Is it possible to move down records with the down button in a tabular form to the same field in the next record.
View 11 Replies
View Related
Dec 6, 2013
How do I move combo box label into the form header area while leaving the actual field title in the detail area in a subform so they looked stacked like the other items??
View 1 Replies
View Related
Oct 15, 2014
I've just created a form and I'm trying to move and size the fields but they seem to be grouped together and whatever I do to one happens to all of them. I select one field and just that field has the orange outline but when I move it they all move.
View 5 Replies
View Related
Feb 4, 2014
There is a light border that is still there after I remove the text that was in the box. I want to remove the ghost image, for lack of a better name, that is left.
Also all the images, fields, are locked together. I want to remove some individually,without moving everything.
I'm in the "LayOut View" of Access 15.0.4551 Office 365 Home Premium.
View 2 Replies
View Related
Dec 10, 2013
I have two subforms on a "Page"/Tabs. Subform #1 is a continuous form which accepts data about dimensions of a pattern piece. The other subform needs to update its information display each time the last control of the first subform loses focus, because it tells me how much material is required for all pieces of this pattern that are entered.
My first feeble attempt at this was to add the following code to the "Lost Focus" event of the final control on the first subform:
Form.Parent.Refresh
This succeeded in forcing the second subform to re-run its calculation.
However, after the recalculation took place, I wasn't able to move to the next record on the first subform. This subform is a continuous form, and I need to be able to add another row of data and then see the second subform change based on the additional information in the first subform.
Obviously I've done this wrong.
View 1 Replies
View Related
Mar 5, 2008
Hi,
i am looking for advice on listboxes. i have various books which all happily state everything exept how to use them!!
1st advice-
i need to know how to create an SQL statement on the listbox so it shows filtered dsata from a query. i am trying to filter by date so the list box could show multiple items carried out on the same date. is it:
SELECT Query.Field From Query Where Field
2nd advice-
a listbox shows data based on a query showing payments. i click on the payment in the listbox and a form opens with the specific data showing.
i have looked around but cannot find much on them.
help would be gratefully received as im currently stuck.
thanks,
NS
View 4 Replies
View Related
Jul 17, 2005
Hello,
I have two tables: Categories and Subcategories.
Categories contains one field: CategoryName
Subcategories contains two fields: ParentCategoryName and SubcategoryName.
In a third talbe I want to select a category from a listbox, then have the subcategory listbox update automatically with the possiblities. Is this possible?
Thanks.
View 1 Replies
View Related
Sep 1, 2007
Maybe somebody can help me with this... in my form I have two listboxes, first one to select the name of the client and the second one to select the contact person of the client... both are linked to a seperate table...
first listbox works fine, only the second one gives me troubles... in the source query I link the ClientID to the ID of the first listbox with...
Forms![PRODUCTIONS]![ClientID]
when I run the form, I get all the time a message window on my screen with the text Forms![PRODUCTIONS]![ClientID] and asking a value for it... I think that I do something wrong with getting the ID from the first listbox....
can somebody help me with this what to do ?
View 2 Replies
View Related
Feb 11, 2005
Hi,
Trying to populate a listbox using a .txt file created used WORD. This is the code i'm using:
Private Sub cmdDisplayFile_Click()
On Error GoTo text_open_error
Dim sTemp As String
Open "m:myaccessumber.txt" For Input As #1
Do While Not EOF(1)
MsgBox ("in loop")
Line Input #1, sTemp
lstShowTextFile.AddItem sTemp
Loop
Close #1
I'm getting nothing in the ListBox. Any hints would be much appreciated.
text_open_exit:
Exit Sub
text_open_error:
MsgBox Err.Description
Resume text_open_exit
View 2 Replies
View Related