473,387 Members | 1,463 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,387 software developers and data experts.

unexpected end of statement

rcollins
234 100+
I was changing a few things in my database when I came across this error, doesn't like my code when I am trying to use the comma to seperate the last ans first name, thinks i am at the end of a line. How can I fix this? Thanks
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check76_AfterUpdate()
  2.     If Me!Check76 Then    'is true
  3.         Me.List26.RowSource = "SELECT tblStaff.ID, [LastName] & ", " & [FirstName] AS Expr1, tblStaff.FirstName, IIf(tblStaff.Current,'Yes','No') AS txtIsStaffCurrent FROM tblStaff ORDER BY tblStaff.LastName;"
  4.     Else
  5.         Me.List26.RowSource = "SELECT tblStaff.ID, [LastName] & ", " & [FirstName] AS Expr1, tblStaff.FirstName, IIf(tblStaff.Current,'Yes','No') AS txtIsStaffCurrent WHERE (((tblStaff.Current) = True)) ORDER BY tblStaff.LastName;"
  6.      End If
  7. End Sub
  8.  
Mar 31 '08 #1
2 3936
nspader
78
I was changing a few things in my database when I came across this error, doesn't like my code when I am trying to use the comma to seperate the last ans first name, thinks i am at the end of a line. How can I fix this? Thanks
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check76_AfterUpdate()
  2.     If Me!Check76 Then    'is true
  3.         Me.List26.RowSource = "SELECT tblStaff.ID, [LastName] & ", " & [FirstName] AS Expr1, tblStaff.FirstName, IIf(tblStaff.Current,'Yes','No') AS txtIsStaffCurrent FROM tblStaff ORDER BY tblStaff.LastName;"
  4.     Else
  5.         Me.List26.RowSource = "SELECT tblStaff.ID, [LastName] & ", " & [FirstName] AS Expr1, tblStaff.FirstName, IIf(tblStaff.Current,'Yes','No') AS txtIsStaffCurrent WHERE (((tblStaff.Current) = True)) ORDER BY tblStaff.LastName;"
  6.      End If
  7. End Sub
  8.  
I am also New at Access VBA but I believe you want to change your double quotes (") inside double quotes (") to a single quote ( ' ) on either side. That should work for you.

Nick
Mar 31 '08 #2
rcollins
234 100+
Worked perfect, thank you
Mar 31 '08 #3

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

Similar topics

10
by: James Campbell | last post by:
ok, I am totally new to php and come from an asp background. I basically want to do an If > then > else > end if statement: my page is: <?php require_once('Connections/carresa.php'); ?>...
1
by: Najm Hashmi | last post by:
Hi all , I am trying to create a store procedure and I get the following error: SQL0104N An unexpected token "END-OF-STATEMENT" was found following "END". Expected tokens may include: "JOIN...
6
by: Cro | last post by:
Dear Access Developers, The 'Allow Additions' property of my form is causing unexpected results. I am developing a form that has its 'Default View' property set to 'Continuous Forms' and am...
3
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
62
by: ashu | last post by:
hi look at this code include <stdio.h> int main(void) { int i,j=2; i=j++ * ++j * j++; printf("%d %d",i,j); return 0;
8
by: Jim Michaels | last post by:
C:\prj\quiz\withusers>php tareports.php PHP Parse error: syntax error, unexpected T_ELSE in C:\prj\quiz\withusers\tareports.php on line 205 this is the section of code. if (isset($row4)) {...
3
by: AB | last post by:
Hi to all, I have a problem about a importation of a file *.csv with SQL Server, through a bulk insert, called in a store procedure that a c# sw calls. This is the description of the error:...
2
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
11
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition:...
4
by: maveri4201 | last post by:
I have written a php script (test3.php), which I attached as a text file. Its includes are also attached as text files. I'm trying to run the script here: http://www.wondergy.com/phptestbed/test3.php...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.