Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 20th, 2006, 01:16 PM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
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

Corey

Reply With Quote
  #2 (permalink)  
Old April 20th, 2006, 01:50 PM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default

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

Reply With Quote
  #3 (permalink)  
Old April 21st, 2006, 03:25 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01: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 12:57 PM



All times are GMT -4. The time now is 10:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.