473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 "Watchstation," but it doesn't even work correctly.

Thank you for the help!
Jan 7 '15 #1
1 832
jforbes
1,107 Expert 1GB
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.
Jan 7 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: lread | last post by:
This is a simplistic test table I am trying to create. The syntax is directly based up on the sample code from the BI Redbook: CREATE TABLE CUSDTA021/MQT_DB AS ( SELECT SUM(ML1OQ) AS...
7
by: support | last post by:
Hi, I am trying to change the text of a Command button using the Windows API Function SetWindowText, which I have declared as follows: <DllImport("User32")_ Public Function...
3
by: chris | last post by:
I have a form det-up as a continous form. In the Header of the form I have a command button called "Approve". What I'm looking to do is when the user clicks the command button all of the records...
6
by: martin DH | last post by:
**Urgent Need** I'll throw out the basics and any assistance is very, very, very much appreciated! Access 2003 on XP On a form (frmMain) is an option group of check boxes (ReportFrame) from...
3
by: WiscCard | last post by:
This seems simple enough, but I am having problems. I have a table of customer information. I have a form with various combo boxes displaying unique customer information (in this case, zone and...
6
by: kpfunf | last post by:
I have one form called Accounts, on which there is a command button called EnterNewTransactionButton. This opens another form called Transactions. I want to add some code that will take the value of...
1
by: dekk | last post by:
When running the full macro (not shown), it delivers an error that '=' incorrect syntax. The code is trying to extract data from SQL server into Excel objMyCmd.CommandText = "SELECT BU,...
4
beacon
by: beacon | last post by:
Hi everybody, I have a main form, frmDeficiency, that has a tab control, deficiencyTabControl, that has a subform, fsubEpisodeDetail, on page 2 of the tab control. I also have a command button...
4
by: aanfalsha | last post by:
I require a command button that will filter my subform simultaneoulsy in two fields ( Name and Date of Registration). (i) One field(Name) will be bounded to a combobox (ii) Second field(Date of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.