Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    AccessNovice7 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    13

    sample db

    I'm having trouble getting the file small enough to upload

  2. #17
    AccessNovice7 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    13

    here is the sample - had to zip it

    ok, here is a sample - again, I appreciate all of your time and imput.
    Attached Files Attached Files

  3. #18
    AccessNovice7 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    13
    Oh, I stripped out the excel file import routine - that part is all working fine anyway

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I don't think the Change, Click, GotFocus events for Criteria1 are really needed. Why Click event for Criteria2?

    Selection1 and Selection2 are set for multi-select - do you want to allow multiple parameters for one field? For alternative code review http://allenbrowne.com/ser-50.html

    If field names in combobox are exactly same as in table, Case structure could be reduced. If the fields were all same data type would not need Case.
    Code:
    For Each varItem In Me.Selection2.ItemsSelected
      Select Case Me.Criteria2
        Case "Region", "Fiscal Year"
          strCriteria1 = strCriteria1 & Me.Criteria2 & " = " & Me.Selection2.ItemData(varItem) & " OR "
        Case Else
          strCriteria1 = strCriteria1 & Me.Criteria2 & " = '" & Me.Selection2.ItemData(varItem) & "' OR "
     End Select
    Next
    Last edited by June7; 09-23-2014 at 04:37 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.

  5. #20
    AccessNovice7 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    13
    Thank you so much for taking the time to help me. This piece is working well now and I learned allot. The fields aren't all the same data type unfortunately and I am allowing multiple parameters. So it may not be pretty, but it is doing the job so far in my tests. Have a great evening!

  6. #21
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It took me a while (job kept interfering) but I managed to mangle your dB.

    There were a couple of problems. One was the field data types. The other was that the record source for the subform was a query.
    The code was changing the query SQL after the subform was open. I couldn't figure out a way to close and open the subform to get the new query into the subform.

    So I changed the subform records source to a query I created, "qrySales". Then it was a matter of getting the field types to set the correct delimiters.
    In the code, I set the subform filter property after processing the selections in the list boxes.

    Before all of the above happened, I created another form to get everything working. I prefer the single form when possible...

    Almost forgot: I also created a table to hold the field names of table "Sales". It was easier to make it bend to my will.


    Maybe this will give you more ideas...... it was fun

  7. #22
    AccessNovice7 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    13
    ok, thanks, I'll take a look. Appreciate your time.

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

Similar Threads

  1. Cascading combo boxes
    By Jackie in forum Access
    Replies: 5
    Last Post: 07-26-2013, 09:07 AM
  2. Cascading Combo boxes
    By finsmith in forum Forms
    Replies: 10
    Last Post: 02-12-2013, 09:37 AM
  3. Cascading combo boxes
    By combine21 in forum Forms
    Replies: 3
    Last Post: 12-02-2010, 12:57 PM
  4. Cascading Combo Boxes
    By desireemm1 in forum Programming
    Replies: 1
    Last Post: 10-05-2009, 06:00 AM
  5. Cascading Combo Boxes
    By gjw1012 in forum Access
    Replies: 1
    Last Post: 07-25-2009, 04:59 PM

Tags for this Thread

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