Access Vba Compile Error Expected
Contents |
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 01-14-2003, 10:04 AM #1 MaxNEMC Guest compile error expected to Posts: n/a Compile Error: Expected: = I wrote a function that I want to have 3
Vba Expected = When Calling Sub
parameters for Import_Reports(tblName as String, Specs as String, InputDir as String) When i try to run it, i get: Compile Error: Expected = compile error expected = msgbox BUT If i define 2 of the parameters within the function as vars, leaving only one as an argument, it works fine. I can use any one of the 3 alone as an argument and it works, but any more vba compile error expected list separator or ) than 1 and i get that compile error... i'm stumped! Any help would be greatly appreciated! Max 01-14-2003, 10:49 AM #2 Fornatian Dim Person Join Date: Aug 2000 Location: England Posts: 1,396 Thanks: 0 Thanked 0 Times in 0 Posts Max, A compile error of this nature means that a variable is missing an assignment somewhere. Can you post your code? Also, can you elaborate on.. Quote: If i define 2 of
Excel Vba Compile Error Expected =
the parameters within the function as vars, leaving only one as an argument... __________________ Ian build a better system and they'll build a better idiot. Fornatian View Public Profile Find More Posts by Fornatian 01-14-2003, 10:58 AM #3 MaxNEMC Guest Posts: n/a Function Import_Reports(Specs As String, tblName As String, InputDir as string) Dim ImportFile, ImportErrors As String 'Dummy As Integer 'InputDir = "c:\windows\desktop\adhocrpts\" 'Specs = "Highland Import Specs" ImportFile = Dir(InputDir & "\*.txt") 'Sets the Filename to be imported Do While Len(ImportFile) > 0 'tblName = Left(ImportFile, (InStr(1, ImportFile, ".") - 1)) 'This is to import each file into individual tables 'tblName = "Highland_Raw" DoCmd.TransferText acImportFixed, Specs, tblName, InputDir & ImportFile, False 'DoCmd.RunMacro "Highland" 'DoCmd.DeleteObject acTable, tblName ImportErrors = (Left(ImportFile, (InStr(1, ImportFile, ".") - 1)) & "_ImportErrors") DoCmd.DeleteObject acTable, ImportErrors ImportFile = Dir Loop ---------------------------- heh, sorry about that.... what i mean is, if instead of having 3 parameters to be passed to the function, if i only give it one and then define the other 2 as string variables and assign them their values within the body of the function, then the code works.... 01-14-2003, 11:57 AM #4 Drevlin Data Demon Join Date: Jul 2002 Location: Durham, NC USA Posts: 135 Thanks: 0 Thanked 0 Times in 0 Posts I don't believe the problem is with your function. T
be down. Please try the request again. Your cache administrator is webmaster. Generated Fri, 30 Sep 2016 01:23:25 GMT by s_hv902 (squid/3.5.20)
Help Suggestions Send Feedback Answers Home All Categories Arts & Humanities Beauty & Style Business & Finance Cars & Transportation Computers & Internet Consumer Electronics Dining Out Education & Reference Entertainment & Music Environment https://answers.yahoo.com/question/index?qid=20100814142047AAHUrDn Family & Relationships Food & Drink Games & Recreation Health http://www.tek-tips.com/viewthread.cfm?qid=1183282 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 Canada France Germany India Indonesia Italy Malaysia Mexico compile error New Zealand Philippines Quebec Singapore Taiwan Hong Kong Spain Thailand UK & Ireland Vietnam Espanol About About Answers Community Guidelines Leaderboard Knowledge Partners Points & Levels Blog Safety Tips Computers & Internet Programming & Design Next Access-VBA: Procedure parameters Error:"Expected:="? Here is my code for a Class Procedure: compile error expected Sub fillTextbox(myVaribleDate As String, myVariblePicture As String) Forms!myForm!myTextBox1.SetFocus Forms!myForm!myTextBox1.Text = DLookup("[DayOfWeek]", "linkedTable", "[DateToday] =" & myVaribleDate) Forms!myForm!myImageBox.Picture =... show more Here is my code for a Class Procedure: Sub fillTextbox(myVaribleDate As String, myVariblePicture As String) Forms!myForm!myTextBox1.SetFocus Forms!myForm!myTextBox1.Text = DLookup("[DayOfWeek]", "linkedTable", "[DateToday] =" & myVaribleDate) Forms!myForm!myImageBox.Picture = myVariblePicture End Sub --------------------------------------... And here is where I call the procedure: Private Sub myButton_Click() Dim myObject As New myClass1 myObject.fillTextbox("Date()","g:\myPi... Set myObject = Nothing End Sub --------------------------------------... Problem: After writing the second parameter (i.e., g:\myPictures\churhill"), an error message appears: "Expected: = " I don't know what that means. Pls. help. Thanks a lot. Update: I found the answer: http://www.la-solutions.co.uk/content/MVBA/MVBA-Tips.htm ------------------------------------------------ Suppose we have a simple Subroutine that modifies a variable. This example multiplies the passed variable by a passed value … Sub Multiply (ByRef change As Double, ByVal value As... show more I found the answer: http://www.la-solutions.co.uk/content/MVB
Join INTELLIGENT WORK 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 is your code? Skip, Be Advised! For those this winter, caught in Arctic-like calamity, be consoled...Many are cold, but few are frozen! RE: Compile Error: Expected Case tbiceps (IS/IT--Management) (OP) 27 Jan 06 15:57 This is SQL code generated by access in the QBE window. My goal is to convert this SQL statement into a VBA readable format. However, I will insert the SQL statement in the following block code.Private Sub BeginSrchButton_Click()On Error GoTo Err_BeginSrchButton_ClickIf Combo9 = "All" ThenDoCmd.OpenForm "fReportQuerybyWMSApp", acNormal, "QryProcessOperationsAreaAll", , acFormPropertySettings, acWindowNormal"""/IDEAL