I could use some help with regard to why some of our code is failing on certain machines. I'm getting a general error ‘5’ Null value when attempting to run the code on a machine that has Access 2010. Interestingly, the machine that I use also has Access 2010 and it works successfully on that machine. I've eliminated this from being a permissions issue by logging in as administrator on the user machine failing and the error still occurs. And finally, I checked the Reference Library to find that we are both using the same libraries and there are no “Missing” warnings in either.
The code fails at the simplistic IF THEN statement, which when researched makes me believe that there is an issue with the Option Compare Database versus and Option Explicit in the General Declarations. Could this be the case? We are using "Option Compare Database" in our (general) section.
This is where I need help, can someone please explain how these work? And why this would effect one machine differently than another.
I have included the code for review. And when debugging, the fails begins at line 9:
Dim strPorS As String
strPorS = cmb_PorSorB
Dim strPrm As String
Dim strSnd As String
Dim strdlt As String
'Build string to include both in the Where clause criteria...P and S
If strPorS = "B" Then strPorS = "P or S"
If strPorS = "B" Then strPrm = "P"
If strPorS = "B" Then strSnd = "S"
Thank you for your help and please let me know if you want more specific information regarding the libraries or anything else that may be relevant.