FindFirst

D

DWNH

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'")
 
D

DWNH

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
 
K

Klatuu

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
 
Top