How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • Go back-and-forth until satisfied
    Rate the answer you receive.
Ask Bing Your Own Question
Bing
Bing, Programming Tutor
Category: Programming
Satisfied Customers: 6154
Experience:  Microsoft Certified Solution Developer
96068672
Type Your Programming Question Here...
Bing is online now

Am getting a run time error - incorrect syntax near ':'. in

This answer was rated:

hi, am getting a run time error - incorrect syntax near ':'. in VBA
Customer: replied 15 days ago.
please see attached code if needed

Hello and welcome to JustAnswer, an independent technical support website. My name is ***** ***** it’s my pleasure to be assisting you today.

What kind of syntax error is it? SQL syntax error or VBA syntax error?

Can I see a screenshot of the original error?

Customer: replied 15 days ago.
VBA

Can I see the original syntax error in a screenshot?

Customer: replied 15 days ago.
please see attached screenshot

Please print out the value of SQL_Command or check/copy its value from the debug console then paste it here.

Customer: replied 15 days ago.
sorry am abit new to coding
Customer: replied 15 days ago.
let me send over the original code i use in SQL
Customer: replied 15 days ago.
File attached (73G46TT)

I have no idea why you have to use Excel to show a SQL query.

We need to get the "live", "real-time" value of SQL_Command, not the SQL query you previous wrote on paper (which is nothing to do with the syntax error).

Customer: replied 15 days ago.
o sorry you want me to run the query on sql, and show you the results?

The error is in SQL_Command when running it. Therefore, we need to get a real-time value of SQL_Command, not the SQL query on paper. I may help you troubleshoot it via a remote session.

Customer: replied 15 days ago.
ok I understand, I think I know why the errors coming up. The query itself runs fine on SQL, but when I paste it in VBA i get a compile error

As I previously advise, please print out the value of SQL_Command or check/copy its value from the debug console then paste it here.

Customer: replied 15 days ago.
can you show me how you would "format" the above query in VBA i think my lack of knowledge VBA is causing the problem

As I previously advised, please print out the value of SQL_Command or check/copy its value from the debug console then paste it here.

Customer: replied 15 days ago.
when i try paste it in the reply box, it doesnt seem to work. ill paste it in a document and it you
Customer: replied 15 days ago.
File attached (6M6127S)

An incomplete SQL query is assigned into SQL_Command, as shown below.

Customer: replied 15 days ago.
thanks, ***** ***** the query
Customer: replied 15 days ago.
File attached (QTS1LM7)

You may just run it and see how it goes.

Customer: replied 15 days ago.
comes up with the same error

You may keep using my way to find out the errors or please accept my offer so I can help you troubleshoot on your computer.

Bing and 2 other Programming Specialists are ready to help you
Customer: replied 15 days ago.
am just going to play around with it, if it doesnt work ill message you and accept your offer
thanks

Okay.