Forum Discussion

kantblue's avatar
kantblue
Copper Contributor
Jul 28, 2023

Setting a report to use only database records from an ad-hoc filtered view

Hi - can any one help me - I'm stumped with what seems a simple thing to do with Access 365. I have a database of newspaper articles - I use 'Filter by Form' to view only the database records I want...
  • Karl_Donaubauer's avatar
    Karl_Donaubauer
    Jul 29, 2023

    Hi,

     

    It sounds like you typed the code in the property line. But it belongs in the VBA editor:

     

    1. In the property window go to the "On click" property of the button. Click into the property line. Then a small button with 3 dots (elipsis) appears at the right edge of the line. Click on this small button and select the code editor from the dialog that pops up.

    2. Paste the 3 lines of code exactly where the cursor is in the VBA code editor. Save the code (e.g. with Ctrl+S) and close the code editor.

    The property line should now only say "Event Procedure". Then the button will execute this procedure and you are now a VBA programmer. 😉

     

    Servus
    Karl
    ****************

    Access Bug Trackers

    Access News
    Access DevCon

Resources