Results 1 to 4 of 4
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    Unknown syntax error. Any spare eyes out there?

    Alright, so I'm helping a buddy of mine. He is constantly navigating around in KBB and a couple other sites.

    I am trying to make a form with some text boxes, he can pop in make model year and mileage and run the search thru KBB...

    So seeing the search address below, we can see where we need to change the make, model, year, and mileage.

    So I can pop up the kbb site without issues.. but I am trying to append the rest of the information to the site....

    Example of Search results on KBB :


    http://www.kbb.com/lexus/is/2004-lex...00&crversion=b

    Code:
    Set Tv = Login("http://www.kbb.com/& Forms("frmMainnew").txtMake &/", True)
    I am getting an syntax error with the code above...

    Ultimately I am trying to so something like this...This would replace everything in the search bar with elements of the form....

    Code:
    Set Tv = Login("http://www.kbb.com/& Forms("frmMainnew").txtMake & / & Forms("frmMainnew").txtmodel & /Forms("frmMainnew").txtyear &-& Forms("frmMainnew").txtmake &-& Forms("frmMainnew").txtmodel & /categories/?intent=trade-in-sell&mileage=& Forms("frmMainnew").txtmilage & &crversion=b", True)

  2. #2
    GeekInOhio's Avatar
    GeekInOhio is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2012
    Posts
    25
    Two things:

    1. Try using the format Forms!frmMainnew.txtMake rather than what you're doing. More details / examples here: http://access.mvps.org/access/forms/frm0031.htm

    2. You are missing quotation marks in your concatenation. You have:

    Code:
    Set Tv = Login("http://www.kbb.com/& Forms("frmMainnew").txtMake &/", True)
    It should be this:

    Code:
    Set Tv = Login("http://www.kbb.com/" & Forms("frmMainnew").txtMake & "/", True)
    Or incorporating my suggestion from #1:

    Code:
    Set Tv = Login("http://www.kbb.com/" & Forms!frmMainnew.txtMake & "/", True)
    I hope that helps.

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    That did it, thank you!

  4. #4
    GeekInOhio's Avatar
    GeekInOhio is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2012
    Posts
    25
    Glad to be of help.

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

Similar Threads

  1. Compile Error: Syntax Error in DoCmd.RunSQL Statement
    By Evilferret in forum Programming
    Replies: 1
    Last Post: 08-27-2012, 12:32 PM
  2. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  3. Replies: 7
    Last Post: 01-26-2011, 08:31 PM
  4. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  5. Unknown Error
    By pimlicosnail in forum Forms
    Replies: 1
    Last Post: 02-26-2010, 10:19 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