FindFirst

G

Guest

Using the following code, all I ever get is

Run Time Error 3077, Syntax error (missing operator) in expression

Dim dbsDWMILSPEC As DAO.Database
Dim rstResultsFile As DAO.Recordset
Dim Msg, Style, Title, Help, Ctxt, Response, MyString

Set dbsDWMILSPEC = CurrentDb
Set rstResultsFile = dbsDWMILSPEC.OpenRecordset("Combined Test Results")

rstResultsFile.MoveFirst
x = rstResultsFile![FILE LOC]

rstResultsFile.FindFirst ("FILE LOC = '13834'")

What is the missing operator in the FindFirst statement?

thanks for the help.

DW
 
B

Brendan Reynolds

Because of the space in the field name, you need to put square brackets
around it in the FindFirst expression ...

rstResultsFile.FindFirst ("[FILE LOC] = '13834'")
 
G

Guest

It worked.

Thanks!

Brendan Reynolds said:
Because of the space in the field name, you need to put square brackets
around it in the FindFirst expression ...

rstResultsFile.FindFirst ("[FILE LOC] = '13834'")

--
Brendan Reynolds
Access MVP


DWNH said:
Using the following code, all I ever get is

Run Time Error 3077, Syntax error (missing operator) in expression

Dim dbsDWMILSPEC As DAO.Database
Dim rstResultsFile As DAO.Recordset
Dim Msg, Style, Title, Help, Ctxt, Response, MyString

Set dbsDWMILSPEC = CurrentDb
Set rstResultsFile = dbsDWMILSPEC.OpenRecordset("Combined Test Results")

rstResultsFile.MoveFirst
x = rstResultsFile![FILE LOC]

rstResultsFile.FindFirst ("FILE LOC = '13834'")

What is the missing operator in the FindFirst statement?

thanks for the help.

DW
 
G

Guest

This is a good object lesson in naming.
Use only Letters, Numbers, and the Underscore in names. Do not use spaces,
special characters or any name that could be an Access reserved word (Date,
Name, etc.)

DWNH said:
It worked.

Thanks!

Brendan Reynolds said:
Because of the space in the field name, you need to put square brackets
around it in the FindFirst expression ...

rstResultsFile.FindFirst ("[FILE LOC] = '13834'")

--
Brendan Reynolds
Access MVP


DWNH said:
Using the following code, all I ever get is

Run Time Error 3077, Syntax error (missing operator) in expression

Dim dbsDWMILSPEC As DAO.Database
Dim rstResultsFile As DAO.Recordset
Dim Msg, Style, Title, Help, Ctxt, Response, MyString

Set dbsDWMILSPEC = CurrentDb
Set rstResultsFile = dbsDWMILSPEC.OpenRecordset("Combined Test Results")

rstResultsFile.MoveFirst
x = rstResultsFile![FILE LOC]

rstResultsFile.FindFirst ("FILE LOC = '13834'")

What is the missing operator in the FindFirst statement?

thanks for the help.

DW
 

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

Similar Threads


Top