[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Run time error 3077

Posted on 2005-05-12
3
Medium Priority
?
856 Views
Last Modified: 2012-05-05
I am receiving a run time error '3077' Syntax error (missing operator) in expression on the following line:
 -   rec.FindFirst "FileID = " & rs("FileID").Value & "ClassID = " & classnum
the code is provided below:

If intResult = vbYes Then
 StrSQL = "SELECT FileID, OccupationID FROM EMPLOYEE WHERE TERMINATED = 0"
 StrSQL1 = "SELECT * FROM Employee_Train"
 
 Set db = CurrentDb()
 Set rs = db.OpenRecordset(StrSQL, dbOpenSnapshot, dbReadOnly)
 Set rec = db.OpenRecordset(StrSQL1, dbOpenSnapshot)
 
 Do Until rec.EOF
  rec.FindFirst "FileID = " & rs("FileID").Value & "ClassID = " & classnum
   If rec.NoMatch = False Then
    With rec
     .AddNew
      .Fields("FileID") = rs("FileID").Value
      .Fields("OccupationID") = rs("OccupationID").Value
      .Fields("ClassID") = "& classnum &"
      .Fields("ClassTaken") = False
      .Fields("Date_Ent") = Format(CDate(todaydat), "dd/mm/yyyy")
      .Update
     End With
     rec.MoveNext
     Else
     rec.MoveNext
     End If
     Loop
     rs.Close
     rec.Close
     db.Close
     Set db = Nothing
     End If
     End If
0
Comment
Question by:tupac1979
3 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 total points
ID: 13991444
Try this...

rec.FindFirst "FileID = " & rs("FileID").Value & " AND ClassID = " & classnum
0
 
LVL 7

Expert Comment

by:manthanein
ID: 13991495
if my presumption is correct, cause I never use Findfirst

you should change
"FileID = " & rs("FileID").Value & "ClassID = " & classnum

to
"FileID = " & rs("FileID").Value & " and ClassID = " & classnum
0
 

Author Comment

by:tupac1979
ID: 13991498
Thanks Jim that worked
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question