Ms Access Error 3077
Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. runtime error '3077' help please P: 37 ebasshead 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 Post Reply Share this Question 3 Replies Expert 5K+ P: 8,410 ADezii 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: rs should not be dimensioned as a Generic Object, it is a Recordset Object, so: Expand|Select|Wrap|Line Numbers DimrsAsRecordset If Property is a Numeric Value, you need to change the syntax for the FindFirst Method as so: Expand|Select|Wrap|Line Numbers 'Onlyif[Property]isNumeric rs.FindFirst"[Property]="&Me![Combo4] May 29 '07 #2 reply P: 37 ebasshead Awesome, thank you so much. Ed May 29 '07 #3 reply Expert 5K+ P: 8,410 ADezii 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 reply Message Cancel Changes Post your reply Joi
Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 09-19-2001, 10:15 PM #1 shieldk Guest Posts: n/a runtime error 3077 Hi all, I have this statement in my code <
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business http://stackoverflow.com/questions/15823687/findfirst-vba-access2010-unbound-form-runtime-error Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up .findfirst vba access2010 unbound form runtime error up vote 1 down vote favorite I have the following VBA code to populate unbound fields in ms access an unbound form in Access 2010 : Private Sub Combo0_AfterUpdate() Dim D As Database Dim rsExp As Recordset Dim Criteria As String Set D = CurrentDb Set rsExp = D.OpenRecordset("ExpAsset", DB_OPEN_DYNASET) Criteria = "[serial_number]=" & [Combo0] rsExp.FindFirst Criteria Me!Name = rsExp("User") Me!Type = rsExp("Type") Me!MODEL = rsExp("Model") Me!Notes = rsExp("Notes") Me!Department = rsExp("Department") Me!Status = rsExp("Status") rsExp.Close End Sub I am getting error on this line rsExp.FindFirst Criteria runtime error 3077 Syntax error (Missing operator) ms access error in expression. I have changed the code to Criteria = "[serial_number]=" & Str([Combo0]) but then i get runtime error 13 type mismatch. forms access-vba ms-access-2010 share|improve this question asked Apr 4 '13 at 23:50 user1687929 631211 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted Give yourself an opportunity to examine the criteria you're asking .FindFirst to use. It may not be what you expect. Dim strCriteria As String 'strCriteria = "[serial_number]=" & Me.Combo0 ' since serial_number is text, enclose the Combo0 value in quotes ' when you build strCriteria strCriteria = "[serial_number]='" & Me.Combo0 & "'" Debug.Print strCriteria ' or MsgBox strCriteria if you prefer You can see the output from Debug.Print in the Immediate window. Go there with Ctrl+g If [serial_number] is text data type, and Debug.Print gives you something like either of these, you have a problem. [serial_number]=A0123 [serial_number]= If that doesn't lead you to the solution tell us the data type of [serial_number] and the value of Me.Combo0 when you encounter the error. share|improve this answer edited Apr 5 '13 at 0:39 answered Apr 4 '13 at 23:58 HansUp 79.3k114371 Serial_number is a Text data type as we have alpha numeric serial numbers for our equipment like laptops, hotspots, GPS Etc. –user1687929 Apr 5 '13 at 0:28 Excellent. See