CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: syntax error

  1. #1
    Join Date
    Aug 2015
    Posts
    5

    syntax error

    ="This letter is to verify that " & UCase([LastName]) & IIf(Len([FirstName])=0,"",", ") & UCase([FirstName]) & " " & UCase([MiddleName]) & " has been accepted to study at our institution, accredited by the Accrediting Council for Continuing Education & Training. This student will be enrolled as a full-time international student enrolled in " & [Forms]![Fr_Dialog Rep Acceptance Letter].[CbClass].[Column](1) " & [Forms]![Fr_Dialog Rep Acceptance Letter]![TxtMrMs] " & [Forms]![Fr_Dialog Rep Acceptance Letter]![TxtStdLastName] & "."

    It works when I stop it after the (1) but i need to put the Mr and Mrs as well as the last name any help??

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: syntax error

    The " after the (1) seems out of place as does the one after the MrMs]

    The line may also be to long
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Aug 2015
    Posts
    5

    Re: syntax error

    Hey thanks for the reply

    The 1 works in the code if i leave it there but the rest does not, and if MrMs] is out of place how or where should it be?

    and sorry i did not know about that i am new to this

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: syntax error

    As I said before the Quotes are what look to be a problem

    international student enrolled in " & [Forms]![Fr_Dialog Rep Acceptance Letter].[CbClass].[Column](1) " & [Forms]![Fr_Dialog Rep Acceptance Letter]![TxtMrMs] " & [Forms]![Fr_Dialog Rep Acceptance Letter]![TxtStdLastName] & "."
    Those ones I marked in red don;t look like they should be there.

    Your line may also be to long
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Aug 2015
    Posts
    5

    Re: syntax error

    Thanks man it worked!!!

  6. #6
    Join Date
    Aug 2015
    Posts
    5

    Re: syntax error

    I have more question if you can help me out with when i try to put the date in i get the same error but i only want it to show when they click the yes bubble if not then not appear does this look correct? If not can you help me?

    [ & [Forms]![Fr_Dialog Rep Acceptance Letter]![TxtMrMs] & [Forms]![Fr_Dialog Rep Acceptance Letter]![TxtStdLastName] will begin his studies on =[Forms]![Fr_Dialog Rep Acceptance Letter]![date box][Forms]![Fr_Dialog Rep Acceptance Letter]![bubble two]![Forms]![Fr_Dialog Rep Acceptance Letter]![bubble one] & "." ]

  7. #7
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: syntax error

    I have no idea what bubble is, I don't even know what that code is from. It definitely does not look like VB code, I'm guessing maybe Word VBA but I have never bothered to write code in Word so only a guess.

    Seems very cluttered and hard to follow due to all the repetition of [Forms]![Fr_Dialog Rep Acceptance Letter]. Surely even in Word there is a way to code this without all of that junk in there.
    Always use [code][/code] tags when posting code.

  8. #8
    Join Date
    Aug 2015
    Posts
    5

    Re: syntax error

    Well the thing is im new to vb6 and this is our project im just editing it is in access and im just looking at the code in vb and it looks like that maybe if i could turn the access project into vb6 it would be easier?

    But i dont know how to do that so im stuck

  9. #9
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: syntax error

    Just to be clear when you are in Access and viewing code what you are actually using is VBA. The IDE does say it is VB6 but it really isn't. VB6 is a different and totally separate animal. VBA does share a lot of features with VB and then has other features depending on which product it is used from.

    At any rate the line of code you posted is not a complete line and the part that is there does not look valid. It is far to cluttered and really needs to be trimmed down for the sake of readability.

    I still have no idea what "bubble" is
    Always use [code][/code] tags when posting code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured