Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 20th, 2006, 01:16 PM
Friend of Wrox
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default Compile error: Syntax error: & Else without HELP

Can someone exsplain and show me why this code isnt working?

Private Sub cmdOnOrderReportButton_Click()
DoCmd.OpenReport Me.CboReports, acViewPreview, , "[BuyerDesc]='" & Me.CboPeople.Column(1) & "'"
Else IF
DoCmd.OpenReport Me.CboReports, acViewPreview, , "[null]='" & Me.CboPeople.Column(1) & "'"

End Sub

Thank you


Old April 20th, 2006, 01:50 PM
Friend of Wrox
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey

What I'm trying to get it to do is show all the people that have a name within [BuyerDesc]

Old April 21st, 2006, 03:25 PM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

You have an "Else If," but no initial "If." Think what you would get from someone starting a conversation with you, starting with, " . . . otherwise I need to go to the . . ." You need the initial condition that the otherwise is in opposition to, otherwise there is no context.

You need to either supply the "If" condition on the line where you have "Else If," or remove the word "If."

You need to provide an "End If," unless you are writing a single-line "If" statement.

You have a field named "null"?!? (Try to [u]never</u> use keywords as entity names. The first time you forget to delimit the name, the environment will recognize the keyword (therefore not balking), but the behavior will be anything but what was intended.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error, unexpected T_ELSE in /h vipin k varghese BOOK: XSLT Programmer's Reference, 2nd Edition 4 September 29th, 2011 01:19 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 05:41 PM
VBScript error 0x800A03EA Syntax error edbkegan3 Classic ASP Databases 2 March 29th, 2004 01:57 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.