Results 1 to 6 of 6
  1. #1
    jasdem is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    27

    HTML Table : Expected end of statement error.

    Code:
    strAppointment = strAppointment & "<tr><td">" & _
                                            Format(rcdAppointment![Appointment], "h:mm AM/PM") & "</td><td>" & _
                                            rcdAppointment![DBN] & "</td><td>" rcdAppointment![Address_1]", "rcdAppointment![Address_2] & "</td><td>" &_
                                            rcdAppointment![Room] & "</td><td>" rcdAppointment![FieldCaptain]"</td></tr>"
    I keep getting an expected end of statement error with this code. I am fairly new and this and not sure how to debug. Any insight would be helpful.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You need to separate fixed text and formulas/recordset references with &

    "fixed text" & Whatever & "more text"

    you've missed some.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Also make sure and have a space between the ampersand & and the underscore _ at the end of a line.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Ah, I didn't notice that the line continuation wasn't correct on the second line. Good catch.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jasdem is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    27
    Thanks everyone. I was able to clean up code and get everything to run smoothly.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    We were happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Expected End Of Statement Dcount, Access 2003
    By DetrieZ in forum Queries
    Replies: 1
    Last Post: 07-09-2013, 04:50 PM
  2. Replies: 1
    Last Post: 02-04-2013, 05:52 PM
  3. Expected End of Statement error
    By SamNotSoWise in forum Programming
    Replies: 5
    Last Post: 06-25-2012, 04:41 PM
  4. compile error: expected end of statement
    By RedGoneWILD in forum Programming
    Replies: 5
    Last Post: 07-29-2010, 10:12 AM
  5. Replies: 3
    Last Post: 07-21-2010, 02:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums