Microsoft Access Compile Error Expected
Contents |
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 Learn compile error expected to more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags compile error expected = msgbox Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you,
Vba Expected = When Calling Sub
helping each other. Join them; it only takes a minute: Sign up ms access - vba: Compile Error: expected: = up vote 1 down vote favorite 1 I have a subroutine as below Public Sub updateStagesTable(sName As String,
Excel Vba Compile Error Expected =
percentageValue As Double) stageName = "'" & sName & "'" sSQL = "INSERT INTO StagesT ([Stage Name], [Stage Value In Percentage]) VALUES (" & stageName & "," & percentageValue & ");" DoCmd.SetWarnings False DoCmd.RunSQL sSQL End Sub and I call it from another subroutine as below economy = 3.53 updateStagesTable ("Economy", economy) But I get this compile error Compile Error: expected: = I don't understand what I am doing wrong here. Please help. vba access-vba share|improve vba compile error expected function or variable this question asked Jul 9 '15 at 23:08 user1670773 378215 add a comment| 2 Answers 2 active oldest votes up vote 6 down vote accepted updateStagesTable ("Economy", economy) should be updateStagesTable "Economy", economy with no parentheses See related: Unexpected results from typename share|improve this answer answered Jul 9 '15 at 23:27 Tim Williams 57.3k74263 add a comment| up vote 1 down vote I have never liked this peculiarity of VB so I always use the alternate CALL syntax, in your case this would be: Call updateStagesTable("Economy", economy) which does allow the parentheses that all other languages expect share|improve this answer edited Aug 4 at 9:21 Gareth 2,69321144 answered Jul 24 '15 at 11:00 PeterTaylorXC 111 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged vba access-vba or ask your own question. asked 1 year ago viewed 3427 times active 2 months ago Linked 1 Unexpected results from typename Related 0Openform action was canceled in MS-Access VBA code-2access: vba code failing to compile1VBA Error in Access: “The cammand or a
soon) Ruby (coming soon) Getting Started Code Samples Resources Patterns and Practices App Registration Tool Events Podcasts Training API Sandbox Videos Documentation Office Add-ins Office Add-in Availability Office Add-ins Changelog Microsoft Graph API Office 365 Connectors Office 365 REST APIs
Vba Compile Error Expected List Separator Or )
SharePoint Add-ins Office UI Fabric Submit to the Office Store All Documentation https://www.yammer.com/ http://feeds.feedburner.com/office/fmNx vba compile error byref argument type mismatch Office VBA language reference Visual Basic language reference Error Messages Error Messages Expected Function or variable Expected Function or variable Expected Function vba compile error expected end of statement or variable #Else clause must be preceded by a matching #If #Else If, #Else, or #End If must be preceded by a matching #If #ElseIf must be preceded by a matching #If or #ElseIf and followed by http://stackoverflow.com/questions/31329829/ms-access-vba-compile-error-expected an #ElseIf, #Else, or #End If
Case and Cooling Fetish CPU & Motherboard Technologia Mobile Computing Outpost Networking Matrix Other Hardware Agora Classifieds Ars DIY Forum (Name TBD!) Operating Systems & Software Battlefront http://arstechnica.com/civis/viewtopic.php?t=108545 Microsoft OS & Software Colloquium Linux Kung Fu Windows Technical Mojo Distributed Computing Arcana Macintoshian Achaia Programmer's Symposium The Server Room Ars Lykaion Gaming, Extra Strength Caplets The http://www.tek-tips.com/viewthread.cfm?qid=1183282 Lounge The Soap Box The Boardroom The Observatory Ars Help & Feedback Ars Subscription Member Areas Image Galleries MS Access VBA Newbie question - "Compile Error: Expected: List Separator or compile error )" 3 posts ScruffyNerf "Very Little Gravitas Indeed" Ars Tribunus Angusticlavius Tribus: Adelaide, South Australia Registered: Sep 4, 2006Posts: 8373 Posted: Sat Sep 13, 2008 6:47 am 'Evening,I've been given a task to create a MS Access db for a community support network, and have run into a small bug. As a part of this, I've created a form for data entry of new people to tblPeople. Currently, I'm attempting to get compile error expected a duplicate search performing when data is entered in the form, and am getting the above error.Please note that this is pretty much my first foray into VBA code, and the code itself was kludged together from various places on the net, including the experts-exchange site.Table details:PeopleID: Autonumber Primary KeyFamilyName (Text)PreferredName (Text)Form Details:On the 2nd tab field (PreferredName), I've created a 'BeforeUpdate' Event procedure calling the following VBA code: Private Sub PreferredName_BeforeUpdate(Cancel As Integer) Dim sWhere As String Dim lID As Long 'If both name fields have a value If Nz(FamilyName.Value, "") <> "" And Nz(PreferredName.Value, "") <> "" Then *** lID = VAL(NZ(DLOOKUP("PeopleID","tblPeople","FamilyName = '" & FamilyName.Value & "' AND PreferredName = '" & PreferredName.Value & "'),0)) *** 'see if record returned i.e., lID>0 and it if does not match current id on form then its duplicate If lID <> PeopleID.Value Then MsgBox "Possible duplicates exist. Please do a search for this name before continuing." Cancel = True End If End If End Sub The starred line is what appears to be throwing the compile error, but I have no idea as to why. What am I missing? Any help would be appreciated. Azzmodan Ars Praetorian Tribus: The Netherlands Registered: Dec 13, 2004Posts: 473 Posted: Sat Sep 13, 2008 7:20
FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Modules (VBA Coding) Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Modules (VBA Coding) Forum Compile Error: Expected Case thread705-1183282 Forum Search FAQs Links MVPs Compile Error: Expected Case Compile Error: Expected Case tbiceps (IS/IT--Management) (OP) 27 Jan 06 13:51 This is a line of code in an application. I get a compile error when I attempt to run this code that states the following:(Compile error:Expected Case)SELECT QryProcessOperationsArea.[Report ID], QryProcessOperationsArea.[Customized or Standard], QryProcessOperationsArea.[Report Title], QryProcessOperationsArea.[ApplicationProducing Report], QryProcessOperationsArea.[Report Type] FROM QryProcessOperationsArea;I copied this line of code from the row source of the specific form. Does anyone have any clues? RE: Compile Error: Expected Case SkipVought (Programmer) 27 Jan 06 14:17 You did not provide any VB code -- just SQL.Where