By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,669 Members | 2,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,669 IT Pros & Developers. It's quick & easy.

Run Time Error 3075 Missing Operator

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.