CodeEngine
CodeEngine

Reputation: 296

query Syntax Error Access VBA

I am trying to set the

Me.RecordSource = "SELECT Sequence No,Catalog Number,PO Number,Assignee,Customer Name, Marketing Sales Mgr, Notes, Rating Information From Catalog Number Log 2 WHERE Catalog Number Like '34*' ORDER BY Sequence No" 

but it is giving me a Syntax error. Any ideas why. Any help would be appreciated.A screen shoot of the table is shown below.

Table Catalog NUmber Log 2

Upvotes: 0

Views: 41

Answers (1)

user2941651
user2941651

Reputation:

Please try this:

Me.RecordSource = "SELECT [Sequence No],[Catalog Number],[PO Number],[Assignee],[Customer Name], [Marketing Sales Mgr], [Notes], [Rating Information] From [Catalog Number Log 2] WHERE [Catalog Number] Like '34*' ORDER BY [Sequence No]"

You have white spaces in your table and column names hence they have to be put in brackets [ ] .

Upvotes: 2

Related Questions