Command Button Filter Query Syntax Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • accessnewbie14
    New Member
    • Jan 2015
    • 1

    Command Button Filter Query Syntax Issue

    Hello,

    I have the current setup on a basic database:

    Lessons Learned:Table
    Lessons Learned:Query
    DataEntry (Form)

    On my Form, I have the different textboxes and dropdown boxes for entering the data into the Lessons Learned Table. I have an "Enter Record" button and a new "Find Lessons" button.

    I want the "Find Lessons" button to find any entries in the Lessons Learned Table that match input from the DataEntry form. I can't seem to get the below query to work correctly:

    SELECT [Lessons Learned].[Event], [Lessons Learned].[Date], [Lessons Learned].[Watchstation], [Lessons Learned].[Comment]
    FROM [Lessons Learned]
    WHERE [Lessons Learned].[Watchstation]=[Forms].[DataEntry].[Watchstation];

    I realize this query only matches the field "Watchstati on," but it doesn't even work correctly.

    Thank you for the help!
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #2
    What are you trying to do with the Select Query you have? Stuff it into the Forms Record Source?

    In a situation like this, I would not use a Where Clause and have the Form show every record, then set the Forms Filter as needed to limit the results.

    Comment

    Working...