I have been using the code below to open a form and then go to a patient's record. I am using the OpenArgs function so that after I open the form to the record that I initially chose, I can then navigate to other records without having to close the form first.
'Patient name double click opens PhysicianRecordForm
Private Sub PatientName_DblClick(Cancel As Integer)
Dim strFormName As String
Dim strCriteria As String
strFormName = "PhysicianRecordForm"
strCriteria = "[MRN]= " & Me![MRN]
DoCmd.OpenForm strFormName, OpenArgs:=strCriteria
This has worked well up until the past few weeks when two of my users started getting error messages "record not found". I am getting the error on only about half of the patients, the other half still works well. Decompile and recompile does not help. I think that it is a glitch with the OpenArgs function. Should I be using the TempVars method instead? Any ideas?