mccarthy995
New member
- Local time
- Today, 08:17
- Joined
- Jul 16, 2022
- Messages
- 1
Hello friends,
I'm in need of some help regarding a SQL VBA. I have already tested this on a Windows 10 machine which runs, but on Windows 11 for some reason this doesn't want to work. I've been on this for a week now and Its really starting to wind me up.
The above joins two tables together, both InputWalls & MasterSpecSheetExt where InputWalls.Client and MasterSpecSheetExt.Client match, (Same for CODE)
And then pulls only the record that the user is looking at. Client Site and PlotNo is displayed on the form they're looking at.
Anyway -
I am executing this code now as I type this on the original machine I wrote this on and it works fine. Its a windows 10 machine with Access 2016.
I also have a windows 11 machine running access 2016 (Both versions from 365) and executing this code shows the following error:
Error:
"Either BOF or EOF is True, Or the current record is deleted. Requested Operation requires a current record."
I have checked VBA > Tools > References on both machines to make sure they match, I have looked on stack overflow for similar issues but I get nothing. I have also compiled my code and made sure that was all up to scratch, but I am running out of ideas.
I'm in need of some help regarding a SQL VBA. I have already tested this on a Windows 10 machine which runs, but on Windows 11 for some reason this doesn't want to work. I've been on this for a week now and Its really starting to wind me up.
Code:
Dim wkm, wkmsql
Set wkm = CreateObject("ADODB.Recordset")
wkmsql = "Select * from InputWalls LEFT JOIN MasterSpecSheetExt ON (InputWalls.Client = MasterSpecSheetExt.Client) AND (InputWalls.KitchenMainCode = MasterSpecSheetExt.CODE) WHERE InputWalls.SITE = """ & Me.SITE.Value & """ AND InputWalls.PLOTNO = """ & Me.PLOTNO.Value & """ AND InputWalls.CLIENT = """ & Me.CLIENT.Value & """"
wkm.Open wkmsql, CurrentProject.Connection
MsgBox (wkm!Code) 'for debugging < Error line is here
The above joins two tables together, both InputWalls & MasterSpecSheetExt where InputWalls.Client and MasterSpecSheetExt.Client match, (Same for CODE)
And then pulls only the record that the user is looking at. Client Site and PlotNo is displayed on the form they're looking at.
Anyway -
I am executing this code now as I type this on the original machine I wrote this on and it works fine. Its a windows 10 machine with Access 2016.
I also have a windows 11 machine running access 2016 (Both versions from 365) and executing this code shows the following error:
Error:
"Either BOF or EOF is True, Or the current record is deleted. Requested Operation requires a current record."
I have checked VBA > Tools > References on both machines to make sure they match, I have looked on stack overflow for similar issues but I get nothing. I have also compiled my code and made sure that was all up to scratch, but I am running out of ideas.