Finally got the macro to work with this condition
Tip: Start learning VBA, so much easier and more flexible.Code:="[person_id]= " & [Forms]![Customer Book Loans Form]![Combo24] & " AND [book_id] = " & [Forms]![Customer Book Loans Form]![Loans_final].[Form].[combo75]
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
Yes! That works perfectly! Even after reading it I still can't see the bit that uses the record selector, I would never have figured that out!
Yes, VBA does seem to be the way to go.
Thank you so much for your help!
The only thing is that it is also filtering books that have already been returned, is there a way to include them? Looking at your code, I don't see where it is filtering that, it doesn't mention "returned" at all.
EDIT: Was my query, you code is perfect.
It does not use the record selectors, it uses the book Id of that record.?
So the initial question was a report for that record in the subform
I included the personID, as you might have more than one of those books? Initially I just used the person id, which gave you all the books out, but then realised you were after only the subform record (which seemed strange to me for only one record, but you know your business?)
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
When you get a little more experienced, you could filter for returned/not returned and just use one report, if the layout was the same?
For now little steps and use two separate reports.
What confused me with the macro is that with the initial just person_id it did not need any concatenation, nor an =, and also accepted ! for object separators, yet when I added the second criteria, it would not work the same, that is why there are . and not ! object separators for combo75.
Another tip: Start giving your controls meaningful names. A few months down the line combo75 etc is not going to mean anything to you.
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba