Querying a Sharepoint linked table in MS Access via VBA

codeliftsleep

Board Regular
Joined
Apr 14, 2017
Messages
103
I have 3 sharepoint linked tables in Access and I have a form that users can enter an employee number or employee name. I then want to query one of the tables to find the information and bring it back, but I can't seem to get it working.

The linked table shows up as Employee_Table Client File

I thought I should be able to use DoCmd.RunSQL = "SELECT Employee_Table[Employee #] WHERE Employee_Table[Employee #] = " & empSearchVal & " FROM Employee_Table;" Do I need to somehow include the Client File in the path as well?

However, I keep getting Run Time error 3075: Syntax Error(missing operator) in query expression.

Also once I get this working, I save it to a recordset to get the rows that returned correct?

Sorry for the basic questions, I am using this at work but am used to query SQL DB's from ASP.Net using C#, not VBA...little learning curve
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Just in case...The Employee name or number is coming from the form data, they hit a search button and then it runs the macro to lookup the rows based on that info.
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top