VBA: Error "No value given for one or more required parameters"

FryGirl

Well-known Member
Joined
Nov 11, 2008
Messages
1,368
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I found a workbook which runs an ADODB connection just fine. I'm now rebuilding a workbook to my specs, but the same code which runs on the first workbook will not run on the second.

I get the error, "No value given for one or more required parameters" and it debugs on


VBA Code:
Dim sSQL        As String

VBA Code:
Set RecSt3 = New ADODB.Recordset

sSQL = "SELECT * FROM [A4:B100] where (MemberName is not null and (MemberName=ReportTo));"

RecSt3.Open sSQL, ExcConn, adOpenKeyset

I've checked the tools - references in the VBE and seem to have what is needed. Doing some online research, it said I should have Microsoft ActiveX Data Objects 6.1 and that is checked.

The table is as below. Starts on A4 with the header and column B is just set to a large number.



MemberName

ReportTo
CCCC
CCFCC
CCQCC
FSCCC
FSCAFSCA
FSCNFSCA
FSDCC
FSDAFSDA
FSDEFSDA
FSDLFSDA
FSDPFSDA
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi,

Can you try running the same code but only for:
"SELECT * FROM [A4:B100]"

See if that part works for you.
 
Upvote 0
Hi JustynaMK,

Turns out I'm scrapping the idea of a recordset and have moved in a different direction. Thank you helping out.
 
Upvote 0
No worries! Didn't help at all but I'm glad you're progressing :) take care.
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,448
Members
452,915
Latest member
hannnahheileen

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