Recent content by jlb4350

  1. J

    Filtering report by date range and multiple list boxes

    Sorry for the late reply. Thank you for your help and example. I tried it and gave an error, but it did give me direction on how I can make it work. After several more hours over the weekend, I managed to come up with this code, based on all the replies to this post. It may not be the most...
  2. J

    Filtering report by date range and multiple list boxes

    Thank you for this. Just to be clear though, I hope you don't think I'm being lazy. I tried for hours trying to get this to work with examples from all over the web even before I created this post. I didn't ask for it to be done for me, just an example, so that I can understand how the operators...
  3. J

    Filtering report by date range and multiple list boxes

    Guys, I really appreciate the guidance, but I just can't figure it out. The code from AllenBrowne looks good, and I could make that work if it were on its own, but I just don't understand how to integrate that into my current code that already has the date filter. I'm still learning and I know...
  4. J

    Filtering report by date range and multiple list boxes

    I changed the code to this, but obviously not correct because I get a type mismatch when i run it. Set ctl = Me.lstDrugProduct For Each VarItem In ctl.ItemsSelected strWhere = "[DrugProduct] IN (" & Left$(strWhere, lngLen) & ")" Next VarItem Set ctl = Me.lstDescription For Each...
  5. J

    Filtering report by date range and multiple list boxes

    Ok, i'll give it a shot and post the code when it's done. Let's see what happens...
  6. J

    Filtering report by date range and multiple list boxes

    Thank you all. I understand now why I need to IN clause and what the results should look like. What I don't yet understand though is where I put this into my code. Could you add an example to my original code above? I should be able to work it out from there. Sorry, I'm still a novice :(
  7. J

    Filtering report by date range and multiple list boxes

    The strange thing is that the date filtering works fine. This report was originally a date filter only report, but I needed to add more data to further filter. The code between the commented lines is what I added. If I were to comment those lines out, the report would run fine. I think I'm just...
  8. J

    Filtering report by date range and multiple list boxes

    Thanks Gasman. Let's assume I choose a date range or 2/1/17 - 4/5/19, and then select "Blank Film" in one listbox, and "Specifications" in the other list box. The debug shows this: ([EffectiveDate] >= #02/01/2017#) AND ([EffectiveDate] < #04/05/2019#)Blank Film,Specifications,
  9. J

    Greetings

    Hello. I've been a member here for a long time now, but have only recently started heavily using the forum as I'm getting more and more involved with creating code-driven Access databases. I just wanted to say that this forum has been a goldmine of knowledge for me recently. I've found this to...
  10. J

    Filtering report by date range and multiple list boxes

    This one has me stumped. I have a form that contains two text fields to enter a date range, and three multiple-select list boxes. When a "generate report" button is clicked, I would like the code to display a report that is filtered by the date range entered, and all the data selected from the...
  11. J

    Filtering subform based on multiple comboboxes

    Thank you for the suggestion, but I found the issue just after I posted this. I've been trying fix this for days and it just came to me. Here is my resolution: Even though I had the code built, I had [Event Procedure] entered into the "After Update" properties box only on the first two boxes...
  12. J

    Filtering subform based on multiple comboboxes

    Hello all. I have a form that has a subform and 10 combo boxes that relate to 10 columns in the subform. What I'm trying to do is automatically filter the subform based on the combobox selections, but I'm having trouble. Here is my code: Option Compare Database Private Sub txtClear_Click()...
  13. J

    Filtering any field in subform based on data entered into textbox on main form

    You're correct in that I want to search all fields in the subform. The two fields are only for example purposes but the real database, which unfortunately has a ton of sensitive data, has about 12 fields in the subform, including two different date fields. I was able to get it working just by...
  14. J

    Filtering any field in subform based on data entered into textbox on main form

    Hmmm, i got it working. I deleted the whole form and rebuilt it using the (corrected) code above and it started filtering. So, i guest my next question is, is there a possibility to filter by date range? Let's say I had another field that is of a date type called HireDate. Is there a way to add...
Top Bottom