422,952 Members | 2,321 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,952 IT Pros & Developers. It's quick & easy.

runtime error '3077' help please

P: 37
Hi everybody, I'm getting a syntax error message with my code below (using a combo box to pull data from a table), the combo box will work a few times and then this message pops up.

Runtime error :'3077'
Syntax error (missing operator) in expression

The code is below with...

rs.FindFirst "[Property] = '" & Me![Combo4] & "'"

highlighted in yellow

but I can't see what may be wrong with it, the full expression is below

Option Compare Database

Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Property] = '" & Me![Combo4] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help. Eddie
May 28 '07 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,584
Hi everybody, I'm getting a syntax error message with my code below (using a combo box to pull data from a table), the combo box will work a few times and then this message pops up.

Runtime error :'3077'
Syntax error (missing operator) in expression

The code is below with...

rs.FindFirst "[Property] = '" & Me![Combo4] & "'"

highlighted in yellow

but I can't see what may be wrong with it, the full expression is below

Option Compare Database

Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Property] = '" & Me![Combo4] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks for any help. Eddie
There are only 2 potential problems that I can see:
  1. rs should not be dimensioned as a Generic Object, it is a Recordset Object, so:
    Expand|Select|Wrap|Line Numbers
    1. Dim rs As Recordset
  2. If Property is a Numeric Value, you need to change the syntax for the FindFirst Method as so:
    Expand|Select|Wrap|Line Numbers
    1.  'Only if [Property] is Numeric
    2. rs.FindFirst "[Property] = " & Me![Combo4] 
May 29 '07 #2

P: 37
Awesome, thank you so much. Ed
May 29 '07 #3

ADezii
Expert 5K+
P: 8,584
Awesome, thank you so much. Ed
Ed, glad I was able to assist you. Let me know how you make out.
May 29 '07 #4

Post your reply

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