Access Vba Runtime Error 3077
Contents |
Post your question and get tips & solutions from a community of 418,417 IT Pros & Developers. It's quick & easy. runtime error '3077' help please P: 37 ebasshead Hi everybody, I'm getting a syntax error message runtime error 3077 missing operator with my code below (using a combo box to pull data from a table), the access vba runtime error 2498 combo box will work a few times and then this message pops up. Runtime error :'3077' Syntax error (missing operator) in expression The code access vba runtime error 91 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
Access Vba Runtime Error 3075
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,394 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 access vba runtime error 3141 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,394 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 Join Now >> Sign in to post your reply or Sign up for a free account. Similar topics fatal error C1001: INTERNAL COMPILER ERROR Run Error 3077 - The Apostrophe problem [MC++] Interna
this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can access vba runtime error 6 overflow post: click the register link above to proceed. To start viewing messages,
Runtime Error 3073 Access Vba
select the forum that you want to visit from the selection below. Results 1 to 6 of 6
Runtime Error 2115 Access Vba
Thread: Run-time error 3077 caused by an apostrophe Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode https://bytes.com/topic/access/answers/653859-runtime-error-3077-help-please Switch to Threaded Mode 01-16-04,10:56 #1 daver View Profile View Forum Posts Registered User Join Date Nov 2003 Posts 66 Unanswered: Run-time error 3077 caused by an apostrophe Hello all, I'm using the following code to display a record's details on a form when a name is selected from a combo box... Sub Combo58_AfterUpdate() ' Find the record that matches the http://www.dbforums.com/showthread.php?978510-Run-time-error-3077-caused-by-an-apostrophe control. Me.RecordsetClone.FindFirst "[Name] = '" & Me![Combo58] & "'" Me.Bookmark = Me.RecordsetClone.Bookmark End Sub Thought it was working grand, untill I selected a name from the dropdown that happened to have an apostrophe in it, (ie o'brien). On selecting such a name, I get the message "Run-time error 3077 Syntax error (missing operator) in expression" I know it's something to do with the apostrophe, but don't know how to fix it. I've experimented with the syntax, removing / adding sets of apostrophes etc., but it either makes no difference, or breaks it so that no records display at all. Anyone any ideas? Cheers Dave Reply With Quote 01-16-04,11:39 #2 SHK View Profile View Forum Posts Registered User Join Date May 2003 Posts 144 Here is what you can do. Sub Combo58_AfterUpdate() ' Find the record that matches the control. 'First, check to see if the name contains an apostrophe. If instr(name, "'")> 0 then 'If it does, add another apostrophe to the apostrophe in the name. So, O'Brien 'will become O''Brien. Me.RecordsetClone.FindFirst "[Name] = '" & replace(Me![Combo58], "'", "
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the http://stackoverflow.com/questions/15823687/findfirst-vba-access2010-unbound-form-runtime-error workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions https://ca.answers.yahoo.com/question/index?qid=20070730224819AAUMqjF Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join runtime error 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 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 access vba runtime 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) 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 Ctr
Style Business & Finance Cars & Transportation Computers & Internet Consumer Electronics Dining Out Education & Reference Entertainment & Music Environment Family & Relationships Food & Drink Games & Recreation Health Home & Garden Local Businesses News & Events Pets Politics & Government Pregnancy & Parenting Science & Mathematics Social Science Society & Culture Sports Travel Yahoo Products International Argentina Australia Brazil France Germany India Indonesia Italy Malaysia Mexico New Zealand Philippines Quebec Singapore Taiwan Hong Kong Spain Thailand UK & Ireland United States Vietnam Espanol About About Answers Community Guidelines Leaderboard Knowledge Partners Points & Levels Blog Safety Tips Computers & Internet Programming & Design Next Can someone figure out the reason of Run-time error '3077': in VBA of Microsoft Access 2003? Hello Everybody, In Access 2003, I am using VBA to find a string in a table. Every time I try to execute following line: anRST.FindFirst "John Smith" I get "Run-time error '3077':" which says: Syntax error (missing operator) in expression. Same is true for FindNext,... show more Hello Everybody, In Access 2003, I am using VBA to find a string in a table. Every time I try to execute following line: anRST.FindFirst "John Smith" I get "Run-time error '3077':" which says: Syntax error (missing operator) in expression. Same is true for FindNext, FindLast and FindPrevious. anRST was defined using following code: Set anRST = CurrentDb.OpenRecordset("Test", dbOpenDynaset) Where "Test" is the name of the table. Any ideas what I am missing? Follow 2 answers 2 Report Abuse Are you sure you want to delete this answer? Yes No Sorry, something has gone wrong. Trending Now Answers Best Answer: The error means that your syntax (i.e., grammar) is incorrect. If you look at the syntax for the FindFirst() method you will see that you must specify the table column where you want to search for a value equal to "John Smith." ____________________