Search Form Run Time Error 3075

  • Thread starter richnida via AccessMonster.com
  • Start date
R

richnida via AccessMonster.com

I have the following code behind an unbound textbox field, when selected I
get a runtime error 3075 (missing operator).

The variable strErr "FLAGERROR" could be in any field in table that was
either Chr(9), (10), or (13).

Trying to get the form to only show records where "FLAGERROR" may exists.

The Code:

Private Sub cmdErrFlags_Click()

Dim db As Database
Dim strErr As String
Dim strBegin As String
Dim strWhere As String
Dim strWhere2 As String
Dim strWhole As String

Set db = CurrentDb()

strErr = "FLAGERROR"
strBegin = "Update SNDL Set ERRORFLD = -1 "
strWhere = "Where ACTIVITY Like "
strWhere2 = "*" & strErr & "*" & ";"

strWhole = strBegin & strWhere & strWhere2

Debug.Print strWhole
'strWhole is: Update SNDL Set ERRORFLD = -1 Where ACTIVITY Like
*FLAGERROR*;

DoCmd.RunSQL strWhole 'Run-time error 3075
'Syntax error (missing operator) in query expression 'ACTIVITY Like
*FLAGERROR*'.

End Sub

Thanks,
 
R

richnida via AccessMonster.com

I have the following code behind an unbound textbox field,

Correction: Command Button
 
K

karen trufanenko

richnida via AccessMonster.com said:
I have the following code behind an unbound textbox field, when selected I
get a runtime error 3075 (missing operator).

The variable strErr "FLAGERROR" could be in any field in table that was
either Chr(9), (10), or (13).

Trying to get the form to only show records where "FLAGERROR" may exists.

The Code:

Private Sub cmdErrFlags_Click()

Dim db As Database
Dim strErr As String
Dim strBegin As String
Dim strWhere As String
Dim strWhere2 As String
Dim strWhole As String

Set db = CurrentDb()

strErr = "FLAGERROR"
strBegin = "Update SNDL Set ERRORFLD = -1 "
strWhere = "Where ACTIVITY Like "
strWhere2 = "*" & strErr & "*" & ";"

strWhole = strBegin & strWhere & strWhere2

Debug.Print strWhole
'strWhole is: Update SNDL Set ERRORFLD = -1 Where ACTIVITY Like
*FLAGERROR*;

DoCmd.RunSQL strWhole 'Run-time error 3075
'Syntax error (missing operator) in query expression 'ACTIVITY Like
*FLAGERROR*'.

End Sub

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top