Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error: Expected Case

Status
Not open for further replies.

tbiceps

IS-IT--Management
Nov 23, 2005
106
US
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.[Application Producing 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?
 


You did not provide any VB code -- just SQL.

Where is your code?

Skip,

[glasses] [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled...
Many are cold, but few are frozen![tongue]
 
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_Click

If Combo9 = "All" Then

DoCmd.OpenForm "fReportQuerybyWMSApp", acNormal, "QryProcessOperationsAreaAll", , acFormPropertySettings, acWindowNormal

"""/IDEAL LOCATION FOR SEQUEL STATEMENT/""""

Select QryProcessOperationsArea.[Report ID], QryProcessOperationsArea.[Customized or Standard], QryProcessOperationsArea.[Report Title], QryProcessOperationsArea.[Application Producing Report], QryProcessOperationsArea.[Report Type] FROM QryProcessOperationsArea

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Else

DoCmd.OpenForm "fReportQuerybyWMSApp", acNormal, "QryProcessOperationsArea", , acFormPropertySettings, acWindowNormal
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

End If

Exit_BeginSrchButton_Click:
Exit Sub

Err_BeginSrchButton_Click:
MsgBox Err.Description
Resume Exit_BeginSrchButton_Click
 
VBA is expecting a CASE statement,

Select Case varDisposed
Case "Whatever":MsgBox "Say What?"
Case "What djoo talkn' 'bout?": msgBox "No way"
End Select

Because, you didn't convert to string, regarde ici...

Dim SQL As String

SQL = "Select [Report ID], [Customized or Standard], [Report Title], [Application Producing Report], [Report Type] FROM QryProcessOperationsArea"

tres facile, n'est ce pas?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top