This rather interesting (and a pain while developing). I have a customer running Windows 10 and Access 2016. I copied his tables, querys and forms to my machine (Windows 11 Pro with Office 2021. It said that the access database I created from the copies was 2016 so I thought all was cool. The querys seem to work fine. Tables seem good. And the program that works off of the Form works good THE FIRST TIME. The second..... says I can't update anything because it is still opened by another user (Admin)??? I'm the only user and yes I'm admin also. Don't have this problem on the customer machine but then again I didn't set it up.
What is confusing is I get and error on an excel object the second time:
If ActiveSheet.Name <> rs.Fields("Route") Then
The error says: Run-time error '91'
Object variable or With block variable not set
I don't have a 'With' in the program.
The object variable is: Public XL As Excel.Application Public WB As Excel.Workbook
Set WB = XL.Workbooks.Add
Set WKS = WB.Worksheets(1)
When I set WKS the sheet1 is created and is visible. Then when I execute the IF statement it seems to be gone.
Any ideas? The program works fine on Windows 10 under Access 2016
Thanks folks,
Jim