Code:
strCriteria = "Models = " & Me.Branson_Model_Number & " And Class = "" & Me.RepairClass & """""
There are actually several mistakes in that statement:
- The quotes around me.Repairclass should be single-quote, not double
- You need single quotes around Me.Branson_Model_Number, as it is also string type
- the form control referenced inMe.Branson_Model_Number has spaces in it, not underscores. Access does not recognize underscores as representing spaces, since the underscore is a valid character to use in a field or control name. To reference a field or control with spaces in the name, enclose the field or control name in square brackets: Me.[Branson Model Number]
Once you fix those up, you have this:
strCriteria = "Models = '" & Me![Branson Model Number] & "' And class = '" & Me!repairclass & "'"
which works without error.
Note: Access WILL automatically replace spaces with underscores in the names of event procedures associated with controls that contain spaces in their names.