473,396 Members | 1,785 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,396 software developers and data experts.

Run Time Error 3075 Missing Operator

I have code that works on every from I have created except for the
latest. Here it is:

Private Sub cmdGo_Click()

Dim sSQL As String
Dim selector As String
Dim sText As String

sSQL = "SELECT qryFindRental.[EventID], qryFindRental.[Name],
qryFindRental.[FILENUMBER]," & _
" qryFindRental.[RENTALITEM], qryFindRental.[RENTALDATE],
qryFindRental.[RENTALTYPE]" & _
" FROM qryFindRental" & _
" WHERE qryFindRental." & selector & " LIKE '" & sText & "'"

Me.txtRentalItem.Visible = True
Me.txtRentalType.Visible = True
Me.txtName.Visible = True
Me.txtFileNumber.Visible = True
Me.txtRentalDate.Visible = True
Me.cmdEdit.Visible = True
Me.Line10.Visible = True
Me.RecordSource = sSQL
Me.Requery

End Sub

When I enter text in sText and select the value in my combo box and
click the button I receive the run time error. The difference between
this form and the others is that the code references a query whereas
the others reference a table. Help?

Fred

Aug 8 '06 #1
4 18918
I have 2 words for you; STEP INTO.

Learn it, live it, love it.
fredindy wrote:
I have code that works on every from I have created except for the
latest. Here it is:

Private Sub cmdGo_Click()

Dim sSQL As String
Dim selector As String
Dim sText As String

sSQL = "SELECT qryFindRental.[EventID], qryFindRental.[Name],
qryFindRental.[FILENUMBER]," & _
" qryFindRental.[RENTALITEM], qryFindRental.[RENTALDATE],
qryFindRental.[RENTALTYPE]" & _
" FROM qryFindRental" & _
" WHERE qryFindRental." & selector & " LIKE '" & sText & "'"

Me.txtRentalItem.Visible = True
Me.txtRentalType.Visible = True
Me.txtName.Visible = True
Me.txtFileNumber.Visible = True
Me.txtRentalDate.Visible = True
Me.cmdEdit.Visible = True
Me.Line10.Visible = True
Me.RecordSource = sSQL
Me.Requery

End Sub

When I enter text in sText and select the value in my combo box and
click the button I receive the run time error. The difference between
this form and the others is that the code references a query whereas
the others reference a table. Help?

Fred
Aug 8 '06 #2
I've tried using the step into tool, however, it doesn't work for this
code, or I'm doing something wrong.

ManningFan wrote:
I have 2 words for you; STEP INTO.

Learn it, live it, love it.
fredindy wrote:
I have code that works on every from I have created except for the
latest. Here it is:

Private Sub cmdGo_Click()

Dim sSQL As String
Dim selector As String
Dim sText As String

sSQL = "SELECT qryFindRental.[EventID], qryFindRental.[Name],
qryFindRental.[FILENUMBER]," & _
" qryFindRental.[RENTALITEM], qryFindRental.[RENTALDATE],
qryFindRental.[RENTALTYPE]" & _
" FROM qryFindRental" & _
" WHERE qryFindRental." & selector & " LIKE '" & sText & "'"

Me.txtRentalItem.Visible = True
Me.txtRentalType.Visible = True
Me.txtName.Visible = True
Me.txtFileNumber.Visible = True
Me.txtRentalDate.Visible = True
Me.cmdEdit.Visible = True
Me.Line10.Visible = True
Me.RecordSource = sSQL
Me.Requery

End Sub

When I enter text in sText and select the value in my combo box and
click the button I receive the run time error. The difference between
this form and the others is that the code references a query whereas
the others reference a table. Help?

Fred
Aug 8 '06 #3
Good Lord I'm so blind. I forgot to add this simple declaration

selector = Me.cmbFilter.Value
sText = Me.Text1.Value
fredindy wrote:
I've tried using the step into tool, however, it doesn't work for this
code, or I'm doing something wrong.

ManningFan wrote:
I have 2 words for you; STEP INTO.

Learn it, live it, love it.
fredindy wrote:
I have code that works on every from I have created except for the
latest. Here it is:
>
Private Sub cmdGo_Click()
>
Dim sSQL As String
Dim selector As String
Dim sText As String
>
sSQL = "SELECT qryFindRental.[EventID], qryFindRental.[Name],
qryFindRental.[FILENUMBER]," & _
" qryFindRental.[RENTALITEM], qryFindRental.[RENTALDATE],
qryFindRental.[RENTALTYPE]" & _
" FROM qryFindRental" & _
" WHERE qryFindRental." & selector & " LIKE '" & sText & "'"
>
Me.txtRentalItem.Visible = True
Me.txtRentalType.Visible = True
Me.txtName.Visible = True
Me.txtFileNumber.Visible = True
Me.txtRentalDate.Visible = True
Me.cmdEdit.Visible = True
Me.Line10.Visible = True
Me.RecordSource = sSQL
Me.Requery
>
End Sub
>
When I enter text in sText and select the value in my combo box and
click the button I receive the run time error. The difference between
this form and the others is that the code references a query whereas
the others reference a table. Help?
>
Fred
Aug 8 '06 #4
"fredindy" <fs*****@yahoo.comwrote in message
<11*********************@n13g2000cwa.googlegroups. com>:
I've tried using the step into tool, however, it doesn't work for
this code, or I'm doing something wrong.
No, I don't think you are wrong. I don't think step into will work in
form event code. Set a breakpoint (F9) on one of the first executable
lines of the sub, then go back to the form and trigger the event, then
continue with step into (F8).

--
Roy-Vidar
Aug 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
4
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
1
by: Mike N. | last post by:
Hello- I have a normal application split into a frontend and backend. The tables are in the backend. All tables open correctly from the backend. When in the OBJECTS window (F11) in the front...
3
by: william | last post by:
Hello Everyone, I'm using Access 2000. I entered the following code to do some data validation, however it is not working. I'm trying to ensure that the user cannot enter a duplicate inspection...
6
by: Nadnerb78 | last post by:
Please see code below: strSQL = "SELECT Max(EntryType) AS MaxOfEntryType " & _ "FROM tblForecastData GROUP BY BusinessLine, , Week " & _ "HAVING ((()='" & xx & "') AND ((Week)=" & xx & ")) " ...
5
by: MARTINQC | last post by:
"SELECT ., .Category INTO tblSiteGroupActiveTicketRawData FROM .Base = 'AAAA') OR (.Base = 'BBBB')) AND (.Status != 'Closed');" Above SQL string fails with a runtime error 3075 syntax error...
1
by: kickergirl | last post by:
I recently created a database in Access 2000 that has been distributed to multiple people using various versions of Access. Each person is using it as a standalone database. The database has...
5
by: Ledo | last post by:
I have a form that I want to show invoices in a date range. When clicking on the button I get the following error: Run Time Error 3075 Syntax error (missing operator) in query expression...
22
by: ozgenaga | last post by:
Hi guys, I am trying to insert new data records to a table but I am getting a run-time error. I would appreciate any kind of help. Here is my code: Sub WorstQueryEver() Dim db As...
6
by: ahd2008 | last post by:
Hi, I have a table for the enrollment of the employees: Employee ID Session ID Status(In-Progress;Complete;Cancel;No-Show;Waiting List) as Combo Box Plan Remarks
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.