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

Help with Run-time error '3077' Syntax error (missing operator) in expression

P: 1
Hey I am really stuck and can't figure out what is wrong here is the code line and surrounding code, if anyone can help i would appreciate it. Thanks
This first line is the line that has a problem and the following after the big gap is the whole thing.

MySet.FindFirst Criteria ' Locate first occurrence.

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database   'Use database order for string comparisons
  3. Private Sub Form_BeforeUpdate(Cancel As Integer)
  4.     ' Me![Updated] = Now
  5. End Sub
  7. Private Sub SelectCompany_AfterUpdate()
  8.     Dim Criteria As String, MyDB As Database, MySet As Recordset
  10.     Criteria = "[Company] = " & "'" & Forms![Customers]![SelectCompany] & "'"
  11.     Set MyDB = DBEngine.Workspaces(0).Databases(0)
  12.     Set MySet = Forms![Customers].RecordsetClone
  13.     MySet.FindFirst Criteria    ' Locate first occurrence. 
  15.     Me.Bookmark = MySet.Bookmark
  17.     Me![Company].SetFocus
  18.     Me![SelectCompany] = Null
  20. End Sub
Jul 30 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 3,532
While single lines of code don't really require the use of Code Tags, all code posted consisting of 2 or more lines does.

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

For VBA code the tag is Code=vb (no spaces) with square brackets surrounding it.

Since you're new to the forum, please take the time to read the Posting Guidelines:

Please use [code] tags in future.

Thank you and Welcome to TheScripts!

Linq ;0)>
Jul 30 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.