Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    After looking at your Table Designs/relationships I would suggest stopping and fixing the design errors.
    Consider


    Click image for larger version. 

Name:	Design1.png 
Views:	12 
Size:	61.0 KB 
ID:	45436

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    Finally got the macro to work with this condition
    Code:
    ="[person_id]= " & [Forms]![Customer Book Loans Form]![Combo24] & " AND [book_id] = " & [Forms]![Customer Book Loans Form]![Loans_final].[Form].[combo75]
    Tip: Start learning VBA, so much easier and more flexible.
    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

  3. #18
    Aph002 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2021
    Posts
    7
    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!

  4. #19
    Aph002 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2021
    Posts
    7
    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.

  5. #20
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    Quote Originally Posted by Aph002 View Post
    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!
    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

  6. #21
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,927
    Quote Originally Posted by Aph002 View Post
    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.
    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

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

Similar Threads

  1. Subform record selector not working
    By PrimaryKey in forum Forms
    Replies: 8
    Last Post: 02-23-2018, 11:52 AM
  2. Replies: 5
    Last Post: 10-26-2017, 01:13 PM
  3. Record Selector in Tabbed Forms
    By Michelle_Perron in forum Forms
    Replies: 6
    Last Post: 02-04-2014, 01:58 PM
  4. Replies: 8
    Last Post: 08-09-2013, 09:52 AM
  5. form record selector not working
    By jmk909er in forum Forms
    Replies: 3
    Last Post: 10-21-2010, 08:31 AM

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