473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Compile error: End Select without Select Case

46
I am getting a this compile error on line 22 and I do have the Select case and End Select.

Expand|Select|Wrap|Line Numbers
  1. Select Case [Booking Status]
  2. Case 1
  3.     DoCmd.OpenReport "Charter Order Form", wherecondition:="Bookings.ID='" & Forms![Charter Order Form]![ID] & "'"
  4. Case 2
  5.     If [Invoice #] = 0 Then
  6.        tempinvoiceid = (DMax("Invoice #", "Invoices") + 1)
  7.        Set db = CurrentDb.OpenRecordset("Invoices")
  8.        db.AddNew
  9.        db![Invoice #] = (DMax("Invoice #", "Invoices") + 1)
  10.        db![Amount] = Me![Quote Price]
  11.        db![Billed Date] = Now()
  12.        db![Trip Date] = Me![Date]
  13.        db![School] = Me.Client
  14.        db![School ID] = Me.[School ID]
  15.        db![Discription] = [Number of Buses] & _
  16.          " Bus(es)From " & [Pickup Point Name] & _
  17.          " To " & [Destination Name]
  18.        If Trip_Type = "Field Trip" Then
  19.           Else
  20.            db![Route] = -1
  21.        End If
  22.        db.Update
  23.        DoCmd.OpenReport "Invoice From Charter", _
  24.           wherecondition:="[Invoice #] = " & _
  25.             tempinvoiceid & ""
  26. End Select
Does it have anything to do with the operations preformed in the cases?
Apr 28 '14 #1
3 3080
Luk3r
300 256MB
This may not be what's causing it... but you are missing an End If for your first If statement.
Apr 28 '14 #2
jimatqsi
1,271 Expert 1GB
That most likely is causing it. You'll get an error similar to that whenever you forget a terminator for if/Then, Select Case, For/Next and With/End. Depends which one came first as to what particular error message you see.

Jim
Apr 28 '14 #3
zmbd
5,501 Expert Mod 4TB
That's the ticket, the "IF" at line 5 doesn't have a matching "End IF" prior to line 26.

I've properly "stepped" your code.
>HOWEVER< the stepping is based on what you have coded and as related to how the functions relate (ie line 18 thru 21 - even though I'm certain you intended that "else" to be part of the outter if, I stepped it as though it belonged to the closer "if" construct)
Apr 29 '14 #4

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

Similar topics

2
by: bradleyp | last post by:
Hi all, Hopefully somebody can help. In Access 2002-SP2, I receive an error from the VB Editor if I try to compile the following code (see below). The error is as follows: Compile Error:...
10
by: Chris LaJoie | last post by:
Our company has been developing a program in C# for some time now, and we haven't had any problems with it, but just last night something cropped up that has me, and everyone else, stumped. I...
4
by: andrewcw | last post by:
I am moving some code forward from .NET 1.1. I was able to load the XSL file and perform the transform. The MSDN documentation looks like it should be easy. But I get a compile error. Ideas ?...
3
by: Angus | last post by:
Hello I am getting this compile error: error C2259: 'PublicTON' : cannot instantiate abstract class due to following members: csta2less.h(1755) : see declaration of 'PublicTON' Class is like...
5
by: iheartvba | last post by:
Hi Everyone, I keep on getting an error saying Compile Error: Expected Case in my (MS Access) VBA What I was trying to do was to do a DSUM function for a Table where the criteria was coming from...
11
by: Tim H | last post by:
The following program compiles just fine in C, but not in C++. Can anyone explain why? I have a chunk of code that defines stuff like this in headers (without the extern) that I can not easily...
9
by: Amit Lamba | last post by:
I am trying to run a module from a button on a form where I populate a subform from Query1 with a product formula. The module is supposed to check whether the product formula can be implemented...
4
by: Lindsay Bradley | last post by:
I have code built into a form in Access and everytime I try to open the form it gives me a Compile error: Expected array message and then highlights the word Left. I did not create this program and...
3
by: winson oo | last post by:
I don't know why it pop up this error when I want to compile the program. ( the problem of the souce code that I'm facing in in the bolder style. Thanks for checking! Private Sub...
1
by: iamahmar | last post by:
Sqlquery = "select * from general_journal_temp_TBL " Set Rs = db.OpenRecordset(Sqlquery1, dbOpenDynaset) If Not Rs.EOF Then Do While Not Rs.EOF Sqlquery1 = "select *...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.