Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 42
  1. #16
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What are the exact names of the 6 "Boxes"?

  2. #17
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    You would have to post all relevent code for analysis. How on earth do you deselect output? We could keep going in circles like this forever. I analyse best with the actual objects and their code. If you can't provide project by suggested means, maybe someone with better insight will contribute.

    RuralGuy: see post #9
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    @June7: Sorry, I had missed that.
    His naming sequence needs to be bumped as the 1st one does not seem to end with a number.

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Yeah, post #10 addresses that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    June7,
    Regarding the deselection of items, the following code is used...

    Private Sub lstSelected_DblClick(cancel As Integer)
    On Error GoTo Err_cmdDeselect_Click
    Dim db As Database
    Dim rs As DAO.Recordset
    Dim varItem As Variant
    Dim lngItem As Long
    Dim strItem As String
    Dim strsql As String
    Dim rsMan As DAO.Recordset

    Set db = CurrentDb
    strsql = "SELECT * FROM tblOutputFormatT WHERE IDTask LIKE '" & Me.TaskNum & "'"
    Set rs = db.OpenRecordset(strsql, dbOpenDynaset)

    With Me!lstSelected
    For Each varItem In .ItemsSelected
    ' lngItem = .Column(0, varItem)
    strItem = .Column(0, varItem)

    With rs
    .MoveFirst
    .FindFirst "[IDOutput] = '" & strItem & "'"

    If Not .NoMatch Then
    .delete
    End If

    End With
    Next varItem

    End With

    rs.Close
    Set rs = Nothing
    Set db = Nothing

    ' With Me!lstSelected
    ' For lngItem = 0 To .ListCount - 1
    ' .Selected(lngItem) = False
    ' Next lngItem
    ' End With

    Me.lstSelected.Requery
    Me.lstAvailable.Requery
    Me.lstSelected = vbNullString

    Exit_cmdDeselect_Click:
    Exit Sub
    Err_cmdDeselect_Click:
    MsgBox Err.Description
    Resume Exit_cmdDeselect_Click
    End Sub

  6. #21
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    Ok so i've managed to get the Qty box to show, however the first Qty box doesn't show until the second choice has been made. (See pic), secondly when you move on to the next record the same Qty box still shows. Thirdly when you exit the form and go back into it the Qty boxes have dissappeared completely. (see Pic)
    Lastly if i select more than 6 items i get an error message "Cannot find the field (Numoutput7) refferred to in your expression.

    HELLP!!!

  7. #22
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Well, how many items are users allowed to select? As I understand, you need a quantity box for each selected item. Your setup has 6 quantity boxes. Should users be limited to that (will need code to control)? If not, this is looking like an unworkable design.

    Also beginning to think the easier option is, once users make selection of sizes, to click a button that opens a form with the selected size records and input quantities into this form instead of trying to control the visibility/nonvisibility of controls in interactions with this form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #23
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    I think that a limit of 6 selections will be fine, but how do you code for that, have sent PM with details ref your PM.

  9. #24
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    June7,
    I have found another sample DB that has the same kind of list box that my form has on it, maybe it would be easier to use this than mine.

  10. #25
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Yes, made life much easier. Your project was proving to be an aggravating although educational exercise. It would have taken me a lot more time to get it to work, if at all.

    See if this is what you want. The demo you provided uses command buttons to trigger the update of listboxes. I retained that structure. If you want to use event of listboxes, will need to rework code. It may be a little more complicated.

    I will remove the file after you respond or in a few days. EDIT: Purpose served, file removed. Suggested code was a procedure to set the visibility textboxes that could be called from any other procedure of the form.
    Code:
    Private Sub SetQtyBoxes()
    Dim i As Integer
    For i = 1 To 6
        Me.Controls("tbxQty" & i).Visible = False
    Next
    For i = 1 To Me.lstSelected.ListCount
        Me.Controls("tbxQty" & i).Visible = True
    Next
    End Sub
    Also, to make sure number of selections is limited:
    If Me.lstAvailable.ItemsSelected.Count + Me.lstSelected.ListCount > 6 Then
    MsgBox "Only six items may be selected. Remove the excess."
    Else
    'code to update lstSelected
    End If
    Last edited by June7; 07-30-2011 at 02:25 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #26
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    June7,
    Fantastic!!!!, this is exactly what i want, you say that to put this into the event of the listbox would take a little more code, could you not just place the code into the doubleclick event and get the same effect, if not this will be superb.

  12. #27
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Well, try it and see what happens. Either way, user has to click something. The button may be more intuitive because it is visually apparent what it is for. What clue do users have to use double click?

    I just realised these listboxes are set as Extended. User must hold shift key to selecte multiple items and there is no clue for the user this is required. Setting of Simple does not require shift key.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #28
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    Ok, so that works on the doubleclick event of the Listbox (Great) 1 question if i may, if there are no items in the listbox selected, if you click within i get a runtime error 5, Invalid procedure call or argument, when i go to debug mode it shows the line
    strwhere = Left(strwhere, Len(strwhere) - 4)

    Any ??

  14. #29
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Make sure some items are selected:

    If Me.lstSelected.ItemsSelected.Count > 0 Then
    'code to remove selected items
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #30
    1eye1vision is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    35
    That didn't work, placed in the code with items selected, once all items were removed from list if i clicked again then same error.!!

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo box Value Must Show an object: How To
    By vdanelia in forum Forms
    Replies: 6
    Last Post: 02-03-2011, 04:16 AM
  2. Replies: 3
    Last Post: 11-02-2010, 10:14 AM
  3. Replies: 1
    Last Post: 08-05-2010, 12:11 PM
  4. Subform will not show data
    By Brian62 in forum Forms
    Replies: 2
    Last Post: 02-19-2010, 10:43 AM
  5. how to show all data in this querey
    By grad2009 in forum Queries
    Replies: 3
    Last Post: 02-08-2010, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums